Mode-dependent coefficient scanning and directional transforms for different colour sampling formats

ABSTRACT

A method of coding 4:2:2 or 4:4:4 video data comprises predicting luminance and/or chrominance samples of an image from other respective reference samples derived from the same image according to a prediction mode associated with a sample to be predicted, the prediction mode being selected for each of a plurality of blocks of samples, from a set of two or more candidate prediction modes; detecting differences between the samples and the respective predicted samples; selecting a frequency-separation transform from two or more candidate frequency separation transforms according to the prediction mode associated with a current block of samples using a mapping between transform and prediction mode, the mapping between different, as between chrominance and luminance samples, for at least the 4:4:4 format; and encoding the detected differences by frequency-separating the differences, using the selected frequency-separation transform.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/396,979, filed Oct. 24, 2014, which is a 371 national stage ofInternational App. No. PCT/GB2013/051071, filed Apr. 26, 2013, whichclaims the benefit of the earlier filing date of GB1211628.1 and GB1207459.7 filed in the United Kingdom Intellectual Property Office on 29Jun. 2012 and 26 Apr. 2012, respectively, and of GB1211629.9 andGB1211623.2, both filed in the United Kingdom Intellectual PropertyOffice on 29 Jun. 2012, the entire contents of each of whichapplications are incorporated herein by reference.

BACKGROUND Field

This disclosure relates to data encoding and decoding.

Description of Related Art

The “background” description provided herein is for the purpose ofgenerally presenting the context of the disclosure. Work of thepresently named inventors, to the extent it is described in thisbackground section, as well as aspects of the description which may nototherwise qualify as prior art at the time of filing, is neitherexpressly or impliedly admitted as prior art against the presentdisclosure.

There are several video data encoding and decoding systems which involvetransforming video data into a frequency domain representation,quantising the frequency domain coefficients and then applying some formof entropy encoding to the quantised coefficients. This can achievecompression of the video data. A corresponding decoding or decompressiontechnique is applied to recover a reconstructed version of the originalvideo data.

Current video codecs (coder-decoders) such as those used in H.264/MPEG-4Advanced Video Coding (AVC) achieve data compression primarily by onlyencoding the differences between successive video frames. These codecsuse a regular array of so-called macroblocks, each of which is used as aregion of comparison with a corresponding macroblock in a previous videoframe, and the image region within the macroblock is then encodedaccording to the degree of motion found between the correspondingcurrent and previous macroblocks in the video sequence, or betweenneighbouring macroblocks within a single frame of the video sequence.

High Efficiency Video Coding (HEVC), also known as H.265 or MPEG-H Part2, is a proposed successor to H.264/MPEG-4 AVC. It is intended for HEVCto improve video quality and double the data compression ratio comparedto H.264, and for it to be scalable from 128×96 to 7680×4320 pixelsresolution, roughly equivalent to bit rates ranging from 128 kbit/s to800 Mbit/s.

In HEVC a so-called 4:2:0 block structure is proposed for consumerequipment, in which the amount of data used in each chroma channel isone quarter that in the luma channel. This is because subjectivelypeople are more sensitive to brightness variations than to colourvariations, and so it is possible to use greater compression and/or lessinformation in the colour channels without a subjective loss of quality.

HEVC replaces the macroblocks found in existing H.264 and MPEG standardswith a more flexible scheme based upon coding units (CUs), which arevariable size structures.

Consequently, when encoding the image data in video frames, the CU sizescan be selected responsive to the apparent image complexity or detectedmotion levels, instead of using uniformly distributed macroblocks.Consequently far greater compression can be achieved in regions withlittle motion between frames and with little variation within a frame,whilst better image quality can be preserved in areas of highinter-frame motion or image complexity.

Each CU contains one or more variable-block-sized prediction units (PUs)of either intra-picture or inter-picture prediction type, and one ormore transform units (TUs) which contain coefficients for spatial blocktransform and quantisation.

Moreover, PU and TU blocks are provided for each of three channels; luma(Y), being a luminance or brightness channel, and which may be thoughtof as a greyscale channel, and two colour difference or chrominance(chroma) channels; Cb and Cr. These channels provide the colour for thegreyscale image of the luma channel. The terms Y, luminance and luma areused interchangeably in this description, and similarly the terms Cb andCr, chrominance and chroma, are used interchangeably as appropriate,noting that chrominance or chroma can be used generically for “one orboth of Cr and Cb”, whereas when a specific chrominance channel is beingdiscussed it will be identified by the term Cb or Cr.

Generally PUs are considered to be channel independent, except that a PUhas a luma part and a chroma part. Generally, this means that thesamples forming part of the PU for each channel represent the sameregion of the image, so that there is a fixed relationship between thePUs between the three channels. For example, for 4:2:0 video, an 8×8 PUfor Luma always has a corresponding 4×4 PU for chroma, with the chromaparts of the PU representing the same area as the luma part, butcontaining a smaller number of pixels because of the subsampled natureof the 4:2:0 chroma data compared to the luma data in 4:2:0 video. Thetwo chroma channels share intra-prediction information; and the threechannels share inter-prediction information. Similarly, the TU structurealso has a fixed relationship between the three channels.

However, for professional broadcast and digital cinema equipment, it isdesirable to have less compression (or more information) in the chromachannels, and this may affect how current and proposed HEVC processingoperates.

SUMMARY

The present disclosure addresses or mitigates problems arising from thisprocessing.

Respective aspects and features of the present disclosure are defined inthe appended claims.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary, but are notrestrictive, of the present technology.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete appreciation of the disclosure and many of the attendantadvantages thereof will be readily obtained as the same becomes betterunderstood by reference to the following detailed description whenconsidered in connection with the accompanying drawings, wherein:

FIG. 1 schematically illustrates an audio/video (A/V) data transmissionand reception system using video data compression and decompression;

FIG. 2 schematically illustrates a video display system using video datadecompression;

FIG. 3 schematically illustrates an audio/video storage system usingvideo data compression and decompression;

FIG. 4 schematically illustrates a video camera using video datacompression;

FIG. 5 provides a schematic overview of a video data compression anddecompression apparatus;

FIG. 6 schematically illustrates the generation of predicted images;

FIG. 7 schematically illustrates a largest coding unit (LCU);

FIG. 8 schematically illustrates a set of four coding units (CU);

FIGS. 9 and 10 schematically illustrate the coding units of FIG. 8sub-divided into smaller coding units;

FIG. 11 schematically illustrates an array of prediction units (PU);

FIG. 12 schematically illustrates an array of transform units (TU);

FIG. 13 schematically illustrates a partially-encoded image;

FIG. 14 schematically illustrates a set of possible intra-predictiondirections;

FIG. 15 schematically illustrates a set of prediction modes;

FIG. 16 schematically illustrates an up-right diagonal scan;

FIG. 17 schematically illustrates a video compression apparatus;

FIGS. 18a and 18b schematically illustrate possible block sizes;

FIG. 19 schematically illustrates the use of co-located information fromchroma and luma blocks;

FIG. 20 schematically illustrates a situation in which co-locatedinformation from one chroma channel is used in respect of another chromachannel;

FIG. 21 schematically illustrates pixels used for an LM-CHROMA mode;

FIG. 22 schematically illustrates a set of luma prediction directions;

FIG. 23 schematically illustrates the directions of FIG. 22, as appliedto a horizontally sparse chroma channel;

FIG. 24 schematically illustrates the directions of FIG. 22 mapped to arectangular chroma pixel array;

FIGS. 25-28 schematically illustrate luma and chroma pixelinterpolation;

FIGS. 29a and 29b schematically illustrates quantisation parametertables for 4:2:0 and 4:2:2 respectively;

FIGS. 30 and 31 schematically illustrate quantisation variation tables;

FIG. 32 schematically illustrates an arrangement for modifying an anglestep;

FIG. 33 schematically illustrates the modification of angle steps;

FIGS. 34 and 35 schematically illustrate scan patterns;

FIG. 36 schematically illustrates the selection of scan patternaccording to prediction mode;

FIG. 37 schematically illustrates the selection of scan patternaccording to prediction mode for a rectangular chroma block;

FIG. 38 schematically illustrates an arrangement for selecting a scanpattern;

FIG. 39 schematically illustrates an arrangement for selecting afrequency-separation transform;

FIG. 40 schematically illustrates a CABAC encoder;

FIGS. 41A-41D schematically illustrate a previously proposedneighborhood allocation; and

FIGS. 42A to 45 schematically illustrate context variable allocationaccording to embodiments of the disclosure.

DESCRIPTION OF THE EMBODIMENTS

Referring now to the drawings, FIGS. 1-4 are provided to give schematicillustrations of apparatus or systems making use of the compressionand/or decompression apparatus to be described below in connection withembodiments of the disclosure.

All of the data compression and/or decompression apparatus to bedescribed below may be implemented in hardware, in software running on ageneral-purpose data processing apparatus such as a general-purposecomputer, as programmable hardware such as an application specificintegrated circuit (ASIC) or field programmable gate array (FPGA) or ascombinations of these. In cases where the embodiments are implemented bysoftware and/or firmware, it will be appreciated that such softwareand/or firmware, and non-transitory data storage media by which suchsoftware and/or firmware are stored or otherwise provided, areconsidered as embodiments of the present disclosure.

FIG. 1 schematically illustrates an audio/video data transmission andreception system using video data compression and decompression.

An input audio/video signal 10 is supplied to a video data compressionapparatus 20 which compresses at least the video component of theaudio/video signal 10 for transmission along a transmission route 30such as a cable, an optical fibre, a wireless link or the like. Thecompressed signal is processed by a decompression apparatus 40 toprovide an output audio/video signal 50. For the return path, acompression apparatus 60 compresses an audio/video signal fortransmission along the transmission route 30 to a decompressionapparatus 70.

The compression apparatus 20 and decompression apparatus 70 cantherefore form one node of a transmission link. The decompressionapparatus 40 and decompression apparatus 60 can form another node of thetransmission link. Of course, in instances where the transmission linkis unit-directional, only one of the nodes would require a compressionapparatus and the other node would only require a decompressionapparatus.

FIG. 2 schematically illustrates a video display system using video datadecompression. In particular, a compressed audio/video signal 100 isprocessed by a decompression apparatus 110 to provide a decompressedsignal which can be displayed on a display 120. The decompressionapparatus 110 could be implemented as an integral part of the display120, for example being provided within the same casing as the displaydevice. Alternatively, the decompression apparatus 110 may be providedas (for example) a so-called set top box (STB), noting that theexpression “set-top” does not imply a requirement for the box to besited in any particular orientation or position with respect to thedisplay 120; it is simply a term used in the art to indicate a devicewhich is connectable to a display as a peripheral device.

FIG. 3 schematically illustrates an audio/video storage system usingvideo data compression and decompression. An input audio/video signal130 is supplied to a compression apparatus 140 which generates acompressed signal for storing by a store device 150 such as a magneticdisk device, an optical disk device, a magnetic tape device, a solidstate storage device such as a semiconductor memory or other storagedevice. For replay, compressed data is read from the store device 150and passed to a decompression apparatus 160 for decompression to providean output audio/video signal 170.

It will be appreciated that the compressed or encoded signal, and astorage medium storing that signal, are considered as embodiments of thepresent disclosure.

FIG. 4 schematically illustrates a video camera using video datacompression. In FIG. 4, an image capture device 180, such as a chargecoupled device (CCD) image sensor and associated control and read-outelectronics, generates a video signal which is passed to a compressionapparatus 190. A microphone (or plural microphones) 200 generates anaudio signal to be passed to the compression apparatus 190. Thecompression apparatus 190 generates a compressed audio/video signal 210to be stored and/or transmitted (shown generically as a schematic stage220).

The techniques to be described below relate primarily to video datacompression and decompression. It will be appreciated that many existingtechniques may be used for audio data compression in conjunction withthe video data compression techniques which will be described, togenerate a compressed audio/video signal. Accordingly, a separatediscussion of audio data compression will not be provided. It will alsobe appreciated that the data rate associated with video data, inparticular broadcast quality video data, is generally very much higherthan the data rate associated with audio data (whether compressed oruncompressed). It will therefore be appreciated that uncompressed audiodata could accompany compressed video data to form a compressedaudio/video signal. It will further be appreciated that although thepresent examples (shown in FIGS. 1-4) relate to audio/video data, thetechniques to be described below can find use in a system which simplydeals with (that is to say, compresses, decompresses, stores, displaysand/or transmits) video data. That is to say, the embodiments can applyto video data compression without necessarily having any associatedaudio data handling at all.

FIG. 5 provides a schematic overview of a video data compression anddecompression apparatus.

A controller 343 controls the overall operation of the apparatus and, inparticular when referring to a compression mode, controls the trialencoding processes (to be described below) to select various modes ofoperation such as CU, PU and TU block sizes.

Successive images of an input video signal 300 are supplied to an adder310 and to an image predictor 320. The image predictor 320 will bedescribed below in more detail with reference to FIG. 6. The adder 310in fact performs a subtraction (negative addition) operation, in that itreceives the input video signal 300 on a “+” input and the output of theimage predictor 320 on a “−” input, so that the predicted image issubtracted from the input image. The result is to generate a so-calledresidual image signal 330 representing the difference between the actualand predicted images.

One reason why a residual image signal is generated is as follows. Thedata coding techniques to be described, that is to say the techniqueswhich will be applied to the residual image signal, tend to work moreefficiently when there is less “energy” in the image to be encoded.Here, the term “efficiently” refers to the generation of a small amountof encoded data; for a particular image quality level, it is desirable(and considered “efficient”) to generate as little data as ispracticably possible. The reference to “energy” in the residual imagerelates to the amount of information contained in the residual image. Ifthe predicted image were to be identical to the real image, thedifference between the two (that is to say, the residual image) wouldcontain zero information (zero energy) and would be very easy to encodeinto a small amount of encoded data. In general, if the predictionprocess can be made to work reasonably well, the expectation is that theresidual image data will contain less information (less energy) than theinput image and so will be easier to encode into a small amount ofencoded data.

The residual image data 330 is supplied to a transform unit 340 whichgenerates a discrete cosine transform (DCT) representation of theresidual image data. The DCT technique itself is well known and will notbe described in detail here. There are however aspects of the techniquesused in the present apparatus which will be described in more detailbelow, in particular relating to the selection of different blocks ofdata to which the DCT operation is applied. These will be discussed withreference to FIGS. 7-12 below. In some embodiments, a differentfrequency-separation transform may selectively be used instead of theDCT, under a system known as MDDT (Mode Dependent DirectionalTransform), which will be described below. For now, it will be assumedthat the DCT transform is in use.

The output of the transform unit 340, which is to say, a set of DCTcoefficients for each transformed block of image data, is supplied to aquantiser 350. Various quantisation techniques are known in the field ofvideo data compression, ranging from a simple multiplication by aquantisation scaling factor through to the application of complicatedlookup tables under the control of a quantisation parameter. The generalaim is twofold. Firstly, the quantisation process reduces the number ofpossible values of the transformed data. Secondly, the quantisationprocess can increase the likelihood that values of the transformed dataare zero. Both of these can make the entropy encoding process, to bedescribed below, work more efficiently in generating small amounts ofcompressed video data.

A data scanning process is applied by a scan unit 360. The purpose ofthe scanning process is to reorder the quantised transformed data so asto gather as many as possible of the non-zero quantised transformedcoefficients together, and of course therefore to gather as many aspossible of the zero-valued coefficients together. These features canallow so-called run-length coding or similar techniques to be appliedefficiently. So, the scanning process involves selecting coefficientsfrom the quantised transformed data, and in particular from a block ofcoefficients corresponding to a block of image data which has beentransformed and quantised, according to a “scanning order” or scanpattern so that (a) all of the coefficients are selected once as part ofthe scan, and (b) the scan tends to provide the desired reordering. Oneexample scanning order which can tend to give useful results is aso-called up-right diagonal scanning order. In some embodiments, a socalled MDCS (Mode Dependent Coefficient Scanning) system may be used,such that the scan pattern may vary from block to block. Sucharrangements will be described in more detail below. For now, it isassumed that the up-right diagonal scan is used.

The scanned coefficients are then passed to an entropy encoder (EE) 370.Again, various types of entropy encoding may be used. Two examples arevariants of the so-called CABAC (Context Adaptive Binary ArithmeticCoding) system and variants of the so-called CAVLC (Context AdaptiveVariable-Length Coding) system. In general terms, CABAC is considered toprovide a better efficiency, and in some studies has been shown toprovide a 10-20% reduction in the quantity of encoded output data for acomparable image quality compared to CAVLC. However, CAVLC is consideredto represent a much lower level of complexity (in terms of itsimplementation) than CABAC. Note that the scanning process and theentropy encoding process are shown as separate processes, but in factcan be combined or treated together. That is to say, the reading of datainto the entropy encoder can take place in the scan order. Correspondingconsiderations apply to the respective inverse processes to be describedbelow. Note that the current HEVC documents under consideration at thetime of filing no longer include the possibility of a CAVLC coefficientencoder.

The output of the entropy encoder 370, along with additional data(mentioned above and/or discussed below), for example defining themanner in which the predictor 320 generated the predicted image,provides a compressed output video signal 380.

However, a return path is also provided because the operation of thepredictor 320 itself depends upon a decompressed version of thecompressed output data.

The reason for this feature is as follows. At the appropriate stage inthe decompression process (to be described below) a decompressed versionof the residual data is generated. This decompressed residual data hasto be added to a predicted image to generate an output image (becausethe original residual data was the difference between the input imageand a predicted image). In order that this process is comparable, asbetween the compression side and the decompression side, the predictedimages generated by the predictor 320 should be the same during thecompression process and during the decompression process. Of course, atdecompression, the apparatus does not have access to the original inputimages, but only to the decompressed images. Therefore, at compression,the predictor 320 bases its prediction (at least, for inter-imageencoding) on decompressed versions of the compressed images.

The entropy encoding process carried out by the entropy encoder 370 isconsidered to be “lossless”, which is to say that it can be reversed toarrive at exactly the same data which was first supplied to the entropyencoder 370. So, the return path can be implemented before the entropyencoding stage. Indeed, the scanning process carried out by the scanunit 360 is also considered lossless, but in the present embodiment thereturn path 390 is from the output of the quantiser 350 to the input ofa complimentary inverse quantiser 420.

In general terms, an entropy decoder 410, the reverse scan unit 400, aninverse quantiser 420 and an inverse transform unit 430 provide therespective inverse functions of the entropy encoder 370, the scan unit360, the quantiser 350 and the transform unit 340. For now, thediscussion will continue through the compression process; the process todecompress an input compressed video signal will be discussed separatelybelow.

In the compression process, the scanned coefficients are passed by thereturn path 390 from the quantiser 350 to the inverse quantiser 420which carries out the inverse operation of the scan unit 360. An inversequantisation and inverse transformation process are carried out by theunits 420, 430 to generate a compressed-decompressed residual imagesignal 440.

The image signal 440 is added, at an adder 450, to the output of thepredictor 320 to generate a reconstructed output image 460. This formsone input to the image predictor 320, as will be described below.

Turning now to the process applied to decompress a received compressedvideo signal 470, the signal is supplied to the entropy decoder 410 andfrom there to the chain of the reverse scan unit 400, the inversequantiser 420 and the inverse transform unit 430 before being added tothe output of the image predictor 320 by the adder 450. Instraightforward terms, the output 460 of the adder 450 forms the outputdecompressed video signal 480. In practice, further filtering may beapplied before the signal is output.

So, the apparatus of FIGS. 5 and 6 can act as a compression apparatus ora decompression apparatus. The functions of the two types of apparatusoverlap very heavily. The scan unit 360 and entropy encoder 370 are notused in a decompression mode, and the operation of the predictor 320(which will be described in detail below) and other units follow modeand parameter information contained in or otherwise associated with thereceived compressed bitstream rather than generating such informationthemselves.

FIG. 6 schematically illustrates the generation of predicted images, andin particular the operation of the image predictor 320.

There are two basic modes of prediction: so-called intra-imageprediction and so-called inter-image, or motion-compensated (MC),prediction.

Intra-image prediction bases a prediction of the content of a block ofthe image on data from within the same image. This corresponds toso-called I-frame encoding in other video compression techniques. Incontrast to I-frame encoding, where the whole image is intra-encoded, inthe present embodiments the choice between intra- and inter-encoding canbe made on a block-by-block basis, though in other embodiments of thedisclosure the choice is still made on an image-by-image basis.

Motion-compensated prediction is an example of inter-image predictionand makes use of motion information which attempts to define the source,in another adjacent or nearby image, of image detail to be encoded inthe current image. Accordingly, in an ideal example, the contents of ablock of image data in the predicted image can be encoded very simply asa reference (a motion vector) pointing to a corresponding block at thesame or a slightly different position in an adjacent image.

Returning to FIG. 6, two image prediction arrangements (corresponding tointra- and inter-image prediction) are shown, the results of which areselected by a multiplexer 500 under the control of a mode signal 510 soas to provide blocks of the predicted image for supply to the adders 310and 450. The choice is made in dependence upon which selection gives thelowest “energy” (which, as discussed above, may be considered asinformation content requiring encoding), and the choice is signalled tothe encoder within the encoded output datastream. Image energy, in thiscontext, can be detected, for example, by carrying out a trialsubtraction of an area of the two versions of the predicted image fromthe input image, squaring each pixel value of the difference image,summing the squared values, and identifying which of the two versionsgives rise to the lower mean squared value of the difference imagerelating to that image area.

The actual prediction, in the intra-encoding system, is made on thebasis of image blocks received as part of the signal 460, which is tosay, the prediction is based upon encoded-decoded image blocks in orderthat exactly the same prediction can be made at a decompressionapparatus. However, data can be derived from the input video signal 300by an intra-mode selector 520 to control the operation of theintra-image predictor 530.

For inter-image prediction, a motion compensated (MC) predictor 540 usesmotion information such as motion vectors derived by a motion estimator550 from the input video signal 300. Those motion vectors are applied toa processed version of the reconstructed image 460 by the motioncompensated predictor 540 to generate blocks of the inter-imageprediction.

The processing applied to the signal 460 will now be described. Firstly,the signal is filtered by a filter unit 560, which will be described ingreater detail below. This involves applying a “deblocking” filter toremove or at least tend to reduce the effects of the block-basedprocessing carried out by the transform unit 340 and subsequentoperations. A sample adaptive offsetting (SAO) filter (described furtherbelow) may also be used. Also, an adaptive loop filter is applied usingcoefficients derived by processing the reconstructed signal 460 and theinput video signal 300. The adaptive loop filter is a type of filterwhich, using known techniques, applies adaptive filter coefficients tothe data to be filtered. That is to say, the filter coefficients canvary in dependence upon various factors. Data defining which filtercoefficients to use is included as part of the encoded outputdatastream.

Adaptive filtering represents in-loop filtering for image restoration.An LCU can be filtered by up to 16 filters, with a choice of filter andan ALF on/off status being derived in respect of each CU within the LCU.Currently the control is at the LCU level, not the CU level.

The filtered output from the filter unit 560 in fact forms the outputvideo signal 480 when the apparatus is operating as a compressionapparatus. It is also buffered in one or more image or frame stores 570;the storage of successive images is a requirement of motion compensatedprediction processing, and in particular the generation of motionvectors. To save on storage requirements, the stored images in the imagestores 570 may be held in a compressed form and then decompressed foruse in generating motion vectors. For this particular purpose, any knowncompression/decompression system may be used. The stored images arepassed to an interpolation filter 580 which generates a higherresolution version of the stored images; in this example, intermediatesamples (sub-samples) are generated such that the resolution of theinterpolated image is output by the interpolation filter 580 is 4 times(in each dimension) that of the images stored in the image stores 570for the luminance channel of 4:2:0 and 8 times (in each dimension) thatof the images stored in the image stores 570 for the chrominancechannels of 4:2:0. The interpolated images are passed as an input to themotion estimator 550 and also to the motion compensated predictor 540.

In embodiments of the disclosure, a further optional stage is provided,which is to multiply the data values of the input video signal by afactor of four using a multiplier 600 (effectively just shifting thedata values left by two bits), and to apply a corresponding divideoperation (shift right by two bits) at the output of the apparatus usinga divider or right-shifter 610. So, the shifting left and shifting rightchanges the data purely for the internal operation of the apparatus.This measure can provide for higher calculation accuracy within theapparatus, as the effect of any data rounding errors is reduced.

The way in which an image is partitioned for compression processing willnow be described. At a basic level, an image to be compressed isconsidered as an array of blocks of samples. For the purposes of thepresent discussion, the largest such block under consideration is aso-called largest coding unit (LCU) 700, which represents a square arrayof typically 64×64 samples (the LCU size is configurable by the encoder,up to a maximum size such as defined by the HEVC documents). Here, thediscussion relates to luminance samples. Depending on the chrominancemode, such as 4:4:4, 4:2:2, 4:2:0 or 4:4:4:4 (GBR plus key data), therewill be differing numbers of corresponding chrominance samplescorresponding to the luminance block.

Three basic types of blocks will be described: coding units, predictionunits and transform units. In general terms, the recursive subdividingof the LCUs allows an input picture to be partitioned in such a way thatboth the block sizes and the block coding parameters (such as predictionor residual coding modes) can be set according to the specificcharacteristics of the image to be encoded.

The LCU may be subdivided into so-called coding units (CU). Coding unitsare always square and have a size between 8×8 samples and the full sizeof the LCU 700. The coding units can be arranged as a kind of treestructure, so that a first subdivision may take place as shown in FIG.8, giving coding units 710 of 32×32 samples; subsequent subdivisions maythen take place on a selective basis so as to give some coding units 720of 16×16 samples (FIG. 9) and potentially some coding units 730 of 8×8samples (FIG. 10). Overall, this process can provide a content-adaptingcoding tree structure of CU blocks, each of which may be as large as theLCU or as small as 8×8 samples. Encoding of the output video data takesplace on the basis of the coding unit structure, which is to say thatone LCU is encoded, and then the process moves to the next LCU, and soon.

FIG. 11 schematically illustrates an array of prediction units (PU). Aprediction unit is a basic unit for carrying information relating to theimage prediction processes, or in other words the additional data addedto the entropy encoded residual image data to form the output videosignal from the apparatus of FIG. 5. In general, prediction units arenot restricted to being square in shape. They can take other shapes, inparticular rectangular shapes forming half of one of the square codingunits (for example, 8×8 CUs can have 8×4 or 4×8 PUs). Employing PUswhich align to image features is not a compulsory part of the HEVCsystem, but the general aim would be to allow a good encoder to alignthe boundary of adjacent prediction units to match (as closely aspossible) the boundary of real objects in the picture, so that differentprediction parameters can be applied to different real objects. Eachcoding unit may contain one or more prediction units.

FIG. 12 schematically illustrates an array of transform units (TU). Atransform unit is a basic unit of the transform and quantisationprocess. Transform units may or may not be square and can take a sizefrom 4×4 up to 32×32 samples. Each coding unit can contain one or moretransform units. The acronym SDIP-P in FIG. 12 signifies a so-calledshort distance intra-prediction partition. In this arrangement only onedimensional transforms are used, so a 4×N block is passed through Ntransforms with input data to the transforms being based upon thepreviously decoded neighbouring blocks and the previously decodedneighbouring lines within the current SDIP-P. SDIP-P is currently notincluded in HEVC at the time of filing the present application.

As mentioned above, coding takes place as one LCU, then a next LCU, andso on. Within an LCU, coding is carried out CU by CU. Within a CU,coding is carried out for one TU, then a next TU and so on.

The intra-prediction process will now be discussed. In general terms,intra-prediction involves generating a prediction of a current block (aprediction unit) of samples from previously-encoded and decoded samplesin the same image. FIG. 13 schematically illustrates a partially encodedimage 800. Here, the image is being encoded from top-left tobottom-right on an LCU basis. An example LCU encoded partway through thehandling of the whole image is shown as a block 810. A shaded region 820above and to the left of the block 810 has already been encoded. Theintra-image prediction of the contents of the block 810 can make use ofany of the shaded area 820 but cannot make use of the unshaded areabelow that. Note however that for an individual TU within the currentLCU, the hierarchical order of encoding (CU by CU then TU by TU)discussed above means that there may be previously encoded samples inthe current LCU and available to the coding of that TU which are, forexample, above-right or below-left of that TU.

The block 810 represents an LCU; as discussed above, for the purposes ofintra-image prediction processing, this may be subdivided into a set ofsmaller prediction units and transform units. An example of a current TU830 is shown within the LCU 810.

The intra-image prediction takes into account samples coded prior to thecurrent TU being considered, such as those above and/or to the left ofthe current TU. Source samples, from which the required samples arepredicted, may be located at different positions or directions relativeto the current TU. To decide which direction (prediction mode) from thecandidate prediction modes is appropriate for a current prediction unit,the mode selector 520 of an example encoder may test all combinations ofavailable TU structures for each candidate direction and select the PUdirection and TU structure with the best compression-efficiency.

The picture may also be encoded on a “slice” basis. In one example, aslice is a horizontally adjacent group of LCUs. But in more generalterms, the entire residual image could form a slice, or a slice could bea single LCU, or a slice could be a row of LCUs, and so on. Slices cangive some resilience to errors as they are encoded as independent units.The encoder and decoder states are completely reset at a slice boundary.For example, intra-prediction is not carried out across sliceboundaries; slice boundaries are treated as image boundaries for thispurpose.

FIG. 14 schematically illustrates a set of possible (candidate)prediction directions. The full set of 34 candidate directions isavailable to a prediction unit of 8×8, 16×16 or 32×32 samples. Thespecial cases of prediction unit sizes of 4×4 and 64×64 samples have areduced set of candidate directions available to them (17 candidatedirections and 5 candidate directions respectively). The directions aredetermined by horizontal and vertical displacement relative to a currentblock position, but are encoded as prediction “modes”, a set of which isshown in FIG. 15. Note that the so-called DC mode represents a simplearithmetic mean of the surrounding upper and left-hand samples.

FIG. 16 schematically illustrates a so-called up-right diagonal scan,being an example scan pattern which may be applied by the scan unit 360.In FIG. 16, the pattern is shown for an example block of 8×8 DCTcoefficients, with the DC coefficient being positioned at the top leftposition 840 of the block, and increasing horizontal and verticalspatial frequencies being represented by coefficients at increasingdistances downwards and to the right of the top-left position 840. Otheralternative scan orders may be used instead.

Variations of the block arrangements and of the CU, PU and TU structureswill be discussed below. These will be discussed in the context of theapparatus of FIG. 17, which is similar in many respects to thatillustrated in FIGS. 5 and 6 discussed above. Indeed, many of the samereference numerals have been used, and these parts will not be discussedfurther.

The main substantive differences with respect to FIGS. 5 and 6 relate tothe filter 560 (FIG. 6), which in FIG. 17 is shown in more detail ascomprising a deblocking filter 1000 and associated encoding decisionblock 1030, a sample adaptive offsetting (SAO) filter 1010 andassociated coefficient generator 1040, and an adaptive loop filter (ALF)1020 and associated coefficient generator 1050.

The deblocking filter 1000 attempts to reduce distortion and to improvevisual quality and prediction performance by smoothing the sharp edgeswhich can form between CU, PU and TU boundaries when block codingtechniques are used.

The SAO filter 1010 classifies reconstructed pixels into differentcategories and then attempts to reduce distortion by simply adding anoffset for each category of pixels. The pixel intensity and edgeproperties are used for pixel classification. To further improve thecoding efficiency, a picture can be divided into regions forlocalization of offset parameters.

The ALF 1020 attempts to restore the compressed picture such that thedifference between the reconstructed and source frames is minimized. Thecoefficients of ALF are calculated and transmitted on a frame basis. TheALF can be applied to the entire frame or to local areas.

As noted above, the proposed HEVC documents use a particular chromasampling scheme known as the 4:2:0 scheme. The 4:2:0 scheme can be usedfor domestic/consumer equipment. However, several other schemes arepossible.

In particular, a so-called 4:4:4 scheme would be suitable forprofessional broadcasting, mastering and digital cinema, and inprinciple would have the highest quality and data rate.

Similarly, a so-called 4:2:2 scheme could be used in professionalbroadcasting, mastering and digital cinema with some loss of fidelity.

These schemes and their corresponding possible PU and TU blockstructures are described below.

In addition, other schemes include the 4:0:0 monochrome scheme.

In the 4:4:4 scheme, each of the three Y, Cb and Cr channels have thesame sample rate. In principle therefore, in this scheme there would betwice as much chroma data as luma data.

Hence in HEVC, in this scheme each of the three Y, Cb and Cr channelswould have corresponding PU and TU blocks that are the same size; forexample an 8×8 luma block would have corresponding 8×8 chroma blocks foreach of the two chroma channels.

Consequently in this scheme there would generally be a direct 1:1relationship between block sizes in each channel.

In the 4:2:2 scheme, the two chroma components are sampled at half thesample rate of luma (for example using vertical or horizontalsubsampling, but for the purposes of the present description, horizontalsubsampling is assumed). In principle therefore, in this scheme therewould be as much chroma data as luma data, though the chroma data wouldbe split between the two chroma channels.

Hence in HEVC, in this scheme the Cb and Cr channels would havedifferent size PU and TU blocks to the luma channel; for example an 8×8luma block could have corresponding 4 wide×8 high chroma blocks for eachchroma channel.

Notably therefore in this scheme the chroma blocks could be non-square,even though they correspond to square luma blocks.

In the currently proposed HEVC 4:2:0 scheme, the two chroma componentsare sampled at a quarter of the sample rate of luma (for example usingvertical and horizontal subsampling). In principle therefore, in thisscheme there is half as much chroma data as luma data, the chroma databeing split between the two chroma channels.

Hence in HEVC, in this scheme again the Cb and Cr channels havedifferent size PU and TU blocks to the luma channel. For example an 8×8luma block would have corresponding 4×4 chroma blocks for each chromachannel.

The above schemes are colloquially known in the art as ‘channel ratios’,as in ‘a 4:2:0 channel ratio’; however it will be appreciated from theabove description that in fact this does not always mean that the Y, Cband Cr channels are compressed or otherwise provided in that ratio.Hence whilst referred to as a channel ratio, this should not be assumedto be literal. In fact, the correct ratios for the 4:2:0 scheme are4:1:1 (the ratios for the 4:2:2 scheme and 4:4:4 scheme are in factcorrect).

Before discussing particular arrangements with reference to FIGS. 18aand 18b , some general terminology will be summarised or revisited.

A Largest Coding Unit (LCU) is a root picture object. Typically, itcovers the area equivalent to 64×64 luma pixels. It is recursively splitto form a tree-hierarchy of Coding Units (CUs). In general terms, thethree channels (one luma channel and two chroma channels) have the sameCU tree-hierarchy. Having said this, however, depending upon the channelratio, a particular luma CU may comprise a different number of pixels tothe corresponding chroma CUs.

The CUs at the end of the tree-hierarchy, which is to say, the smallestCUs resulting from the recursive splitting process (which may bereferred to as leaf CUs) are then split into Prediction Units (PUs). Thethree channels (luma and two chroma channels) have the same PUstructure, except when the corresponding PU for a chroma channel wouldhave too few samples, in which case just one PU for that channel isavailable. This is configurable, but commonly the minimum dimension ofan intra PU is 4 samples; the minimum dimension of an inter PU is 4 lumasamples (or 2 chroma samples for 4:2:0). The restriction on the minimumCU size is always large enough for at least one PU for any channel.

The leaf CUs are also split into Transform Units (TUs). The TUs can—and,when they are too big (for example, over 32×32 samples), must—be splitinto further TUs. A limit is applied so that TUs can be split down to amaximum tree depth, currently configured as 2 levels. i.e. there can beno more than 16 TUs for each CU. An illustrative smallest allowable TUsize is 4×4 samples and the largest allowable TU size is 32×32 samples.Again, the three channels have the same TU structure wherever possible,but if a TU cannot be split to a particular depth for a given channeldue to the size restriction, it remains at the larger size. Theso-called non-square quad-tree transform arrangement (NSQT) is similar,but the method of splitting into four TUs need not be 2×2, but can be4×1 or 1×4.

Referring to FIGS. 18a and 18b , the different block sizes possible aresummarised for CU, PU and TU blocks, with ‘Y’ referring to luma blocksand ‘C’ referring in a generic sense to a representative one of thechroma blocks, and the numbers referring to pixels. ‘Inter’ refers tointer-frame prediction PUs (as opposed to intra-frame prediction PUs).In many cases, only the block sizes for the luma blocks are shown. Thecorresponding sizes of the associated chroma blocks are related to theluma block sizes according to the channel ratios. So, for 4:4:4, thechroma channels have the same block sizes as the luma blocks shown inFIGS. 18a and 18b . For 4:2:2 and 4:2:0, the chroma blocks will eachhave fewer pixels than the corresponding luma block, according to thechannel ratio.

The arrangements shown in FIGS. 18a and 18b concern four possible CUsizes: 64×64, 32×32, 16×16 and 8×8 luma pixels respectively. Each ofthese CUs has a corresponding row of PU options (shown in a column 1140)and TU options (shown in a column 1150). For the possible CU sizesdefined above, the rows of options are referenced as 1100, 1110, 1120and 1130 respectively.

Note that 64×64 is currently a maximum CU size but this restrictioncould change.

Within each row 1100 . . . 1130, different PU options are shownapplicable to that CU size. The TU options applicable to those PUconfigurations are shown horizontally aligned with the respective PUoption(s).

Note that in several cases, multiple PU options are provided. Asdiscussed above, the aim of the apparatus in selecting a PUconfiguration is to match (as closely as possible) the boundary of realobjects in the picture, so that different prediction parameters can beapplied to different real objects.

The block sizes and shapes and PUs are an encoder based decision, underthe control of the controller 343. The current method involvesconducting trials of many TU tree structures for many directions,getting the best “cost” at each level. Here, the cost may be expressedas a measure of the distortion, or noise, or errors, or bit rateresulting from each block structure. So, the encoder may try two or more(or even all available) permutations of block sizes and shapes withinthose allowed under the tree structures and hierarchies discussed above,before selecting the one of the trials which gives the lowest bit ratefor a certain required quality measure, or the lowest distortion (orerrors, or noise, or combinations of these measures) for a required bitrate, or a combination of these measures.

Given the selection of a particular PU configuration, various levels ofsplitting may be applied to generate the corresponding TUs. Referring tothe row 1100, in the case of a 64×64 PU, this block size is too largefor use as a TU and so a first level of splitting (from “level 0” (notsplit) to “level 1”) is compulsory, resulting in an array of four 32×32luma TUs. Each of these may be subjected to further splitting in a treehierarchy (from “level 1” to “level 2”) as required, with the splittingbeing carried out before transforming or quantising that TU isperformed. The maximum number of levels in the TU tree is limited by(for example) the HEVC documents.

Other options are provided for PU sizes and shapes in the case of a64×64 luma pixel CU. These are restricted to use only with inter-codedpictures and, in some cases, with the so-called AMP option enabled. AMPrefers to Asymmetric Motion Partitioning and allows for PUs to bepartitioned asymmetrically.

Similarly, in some cases options are provided for TU sizes and shapes.If NQST (non-square quad-tree transform, basically allowing a non-squareTU) is enabled, then splitting to level 1 and/or level 2 can be carriedout as shown, whereas if NQST is not enabled, the TU sizes follow thesplitting pattern of the respective largest TU for that CU size.

Similar options are provided for other CU sizes.

In addition to the graphical representation shown in FIGS. 18a and 18b ,the numerical part of the same information is provided in the followingtable, though the presentation in FIGS. 18a and 18b is considereddefinitive. “n/a” indicates a mode which is not allowed. The horizontalpixel size is recited first. If a third figure is given, it relates tothe number of instances of that block size, as in(horizontal)×(vertical)×(number of instances) blocks. N is an integer.

CU TU Options Size PU Options Level 0 Level 1 Level 2 64 × 64 64 × 64n/a 32 × 32 × 4 16 × 16 × 4 64 × 32 × 2 (horizontal configuration) n/a32 × 32 × 4 32 × 8 × 4 64 × 16 + 64 × 48 (2 horizontal configurations)32 × 64 × 2 (vertical configuration) n/a 32 × 32 × 4 8 × 32 × 4 16 ×64 + 48 × 64 (2 vertical configurations) 32 × 32 32 × 32 16 × 16 × 4 8 ×8 × 4 32 × 32 32 × 16 × 2 (horizontal configuration) n/a 32 × 8 × 4 16 ×4 × 4 (luma) + 32 × 8 + 32 × 24 (2 horizontal 4 × 4 × 4 (chroma, 4:2:0or 4:2:2) configurations) or 8 × 4 × 4 (chroma, 4:2:2) 16 × 32 × 2(vertical configuration) n/a 8 × 32 × 4 4 × 16 × 4 (luma) + 4 × 4 × 4(chroma) 8 × 32 + 24 × 32 (2 vertical configurations) 16 × 16 16 × 16 16× 16 8 × 8 × 4 4 × 4 × 4 (luma) + 4 × 8 × 4 (chroma) 16 × 8 × 2(horizontal configuration) n/a 16 × 4 × 4 (luma) + 4 × 8 × 4 4 × 4 × 4(luma) + 4 × 8 × 1 (chroma) 16 × 4 + 16 × 12 (2 horizontal (chroma)(4:2:0 or 4:2:2) (4:2:0 or 4:2:2) configurations) 16 × 4 × 4 (luma) + 8× 4 × 4 4 × 4 × 4 (luma) + 8 × 4 × 1 (chroma) (chroma) (4:2:2) (4:2:2) 8× 16 × 2 (vertical configuration) n/a 4 × 16 + 12 × 16 (2 verticalconfigurations) 8 × 8 8 × 8 8 × 8 4 × 4 × 4 (luma) + n/a 4 × 4 × 4 4 × 8× 1 (chroma) 8 × 4 × 2 (horizontal configuration) 4 × 8 × 2 (verticalconfiguration) 4 × 4 × 4 (luma) + 4 × N (chroma) n/a 4 × 4 × 4 (luma) +n/a 4 × 8 × 1 (chroma)

4:2:0, 4:2:2 and 4:4:4 Block Structure Variants

It has been appreciated that both 4:2:0 and 4:4:4 schemes have square PUblocks for intra-prediction coding. Moreover, currently the 4:2:0 schemepermits 4×4 pixel PU & TU blocks.

In embodiments of the present disclosure, it is consequently proposedthat for the 4:4:4 scheme the recursion for CU blocks is permitted downto 4×4 pixels rather than 8×8 pixels, since as noted above in the 4:4:4mode the luma and chroma blocks will be the same size (i.e. the chromadata is not subsampled) and so for a 4×4 CU no PU or TU will need to beless than the already allowed minimum of 4×4 pixels.

Similarly, in the 4:4:4 scheme, in an embodiment of the presentdisclosure each of the Y, Cr, Cb channels, or the Y and the two Cr, Cbchannels together, could have respective CU tree-hierarchies. A flag maythen be used to signal which hierarchy or arrangement of hierarchies isto be used. This approach could also be used for a 4:4:4 RGB colourspace scheme. However, in an alternative, the tree hierarchies forchroma and luma may instead be independent.

In the example of an 8×8 CU in the 4:2:0 scheme, this results in four4×4 luma PUs and one 4×4 chroma PU. Hence in the 4:2:2 scheme, havingtwice as much chroma data, one option is in this case is to have two 4×4chroma PUs, where (for example) the bottom chroma block would correspondin position to the bottom left luma block. However, it is has beenappreciated that using one non-square 4×8 chroma PU in this case wouldbe more consistent with arrangements for the 4:2:0 chroma format.

In the 4:2:0 scheme there are in principle some non-square TU blockspermitted for certain classes of inter-prediction coding, but not forintra-prediction coding. However in inter-prediction coding, whennon-square quad-tree transforms (NSQT) are disabled (which is thecurrent default for the 4:2:0 scheme), all TUs are square. Hence ineffect the 4:2:0 scheme currently enforces square TUs. For example, a16×16 4:2:0 luma TU would correspond with respective Cb & Cr 8×8 4:2:0Chroma TUs.

However, as noted previously, the 4:2:2 scheme can have non-square PUs.Consequently in an embodiment of the present disclosure it is proposedto allow non-square TUs for the 4:2:2 scheme.

For example, whilst a 16×16 4:2:2 luma TU could correspond with tworespective Cb & Cr 8×8 4:2:2 Chroma TUs, in this embodiment it couldinstead correspond with respective Cb & Cr 8×16 4:2:2 Chroma TUs.

Similarly, four 4×4 4:2:2 luma TUs could correspond with two respective4×4 Cb+Cr 4:2:2 TUs, or in this embodiment could instead correspond withrespective 4×8 Cb & Cr 4:2:2 TUs.

Having non-square chroma TUs, and hence fewer TUs, may be more efficientas they are likely to contain less information. However this may affectthe transformation and scanning processes of such TUs, as will bedescribed later.

For 4:4:4, it is possible in embodiments of the disclosure to preventthe luma blocks splitting down to (for example) 4×4 blocks, if that is afurther split than the chroma blocks undergo. This can lead to moreefficient coding.

Finally, for the 4:4:4 scheme it may be preferable to have the TUstructure channel-independent, and selectable at the sequence, picture,slice or finer level.

As noted above, NSQT is currently disabled in the 4:2:0 scheme of HEVC.However, if for inter-picture prediction, NSQT is enabled and asymmetricmotion partitioning (AMP) is permitted, this allows for PUs to bepartitioned asymmetrically; thus for example a 16×16 CU may have a 4×16PU and a 12×16 PU. In these circumstances, further considerations ofblock structure are important for each of the 4:2:0 and 4:2:2 schemes.

For the 4:2:0 scheme, in NSQT the minimum width/height of a TU may berestricted to 4 luma/chroma samples:

Hence in a non-limiting example a 16×4/16×12 luma PU structure has four16×4 luma TUs and four 4×4 chroma TUs, where the luma TUs are in a 1×4vertical block arrangement and the chroma TUs are in a 2×2 blockarrangement.

In a similar arrangement where the partitioning was vertical rather thanhorizontal, a 4×16/12×16 luma PU structure has four 4×16 luma TUs andfour 4×4 chroma TUs, where the luma TUs are in a 4×1 horizontal blockarrangement and the chroma TUs are in a 2×2 block arrangement.

For the 4:2:2 scheme, in NSQT as a non-limiting example a 4×16/12×16luma PU structure has four 4×16 luma TUs and four 4×8 chroma TUs, wherethe luma TUs are in a 4×1 horizontal block arrangement; the chroma TUsare in a 2×2 block arrangement.

However, it has been appreciated that a different structure can beconsidered for some cases. Hence in an embodiment of the presentdisclosure, in NSQT as a non-limiting example 16×4/16×12 luma PUstructure has four 16×4 luma TUs and four 8×4 chroma TUs, but now theluma and chroma TUs are in a 1×4 vertical block arrangement, alignedwith the PU layout (as opposed to the 4:2:0 style arrangement of four4×8 chroma TUs in a 2×2 block arrangement).

Similarly 32×8 PU can have four 16×4 luma TUs and four 8×4 chroma TUs,but now the luma and chroma TUs are in a 2×2 block arrangement.

Hence more generally, for the 4:2:2 scheme, in NSQT the TU block sizesare selected to align with the asymmetric PU block layout. Consequentlythe NSQT usefully allows TU boundaries to align with PU boundaries,which reduces high frequency artifacts that may otherwise occur.

In general terms, embodiments of the disclosure can relate to a videocoding method, apparatus or program operable in respect of images of a4:2:2 format video signal. An image to be encoded is divided into codingunits, prediction units and transform units for encoding, a coding unitbeing a square array of luminance samples and the correspondingchrominance samples, there being one or more prediction units in acoding unit, and there being one or more transform units in a codingunit; in which a prediction unit is an elementary unit of prediction sothat all samples within a single prediction unit are predicted using acommon prediction technique, and a transform unit is a basic unit oftransformation and quantisation.

A Non-square transform mode (such as an NSQT mode) is enabled so as toallow non-square prediction units. Optionally, asymmetric motionpartitioning is enabled so as to allow asymmetry between two or moreprediction units corresponding to a single coding unit.

The controller 343 controls the selection of transform unit block sizesto align with the prediction unit block layout, for example by detectingimage features in the portion of the image corresponding to a PU andselecting TU block sizes in respect of that PU so as to align TUboundaries with edges of image features in the portion of the image.

The rules discussed above dictate which combinations of block sizes areavailable. The encoder may just try different combinations. As discussedabove, a trial may include two or more, through to all availableoptions. The trial encode processes can be carried out according to acost function metric and a result selected according to an assessment ofthe cost function.

Given that there are three levels of variation, according to the CU sizeand shape, the PU size and shape and the TU size and shape, this couldlead to a large number of permutations to be trial-encoded. To reducethis variation, the system could trial encode for a CU size by using anarbitrarily selected one of the PU/TU configurations allowable for eachCU size; then, having selected a CU size, a PU size and shape could beselected by trial encoding the different PU options each with a singlearbitrarily chosen TU configuration. Then, having selected a CU and PU,the system could try all applicable TU configurations to select a finalTU configuration.

Another possibility is that some encoders may use a fixed choice ofblock configuration, or may allow a limited subset of the combinationsset out in the discussions above.

Intra-Prediction

4:2:0 Intra-Prediction

Turning now to FIG. 22, for intra-prediction, HEVC allows for angularchroma prediction.

By way of introduction, FIG. 22 illustrates 35 prediction modesapplicable to luma blocks, 33 of which specify directions to referencesamples for a current predicted sample position 110. The remaining twomodes are mode 0 (planar) and mode 1 (dc). A prediction mode is selectedfor each block from these candidate prediction modes.

HEVC allows chroma to have DC, Vertical, Horizontal, Planar, DM_CHROMAand LM_CHROMA modes.

DM_CHROMA indicates that the prediction mode to be used is the same asthat of the co-located luma PU (i.e. one of the 35 shown in FIG. 22).

LM_CHROMA (linear mode chroma) indicates that co-located luma samples(downsampled as appropriate to the channel ratios) are used to derivethe predicted chroma samples. In this case, if the luma PU from whichthe DM_CHROMA prediction mode would be taken selected DC, Vertical,Horizontal or Planar, that entry in the chroma prediction list isreplaced using mode 34. In the LM_CHROMA mode, the luma pixels fromwhich the chroma pixels are predicted are scaled (and have an offsetapplied if appropriate) according to a linear relationship between lumaand chroma. This linear relationship is derived from surrounding pixels,and the derivation can be carried out on a block by block basis, withthe decoder finishing decoding one block before moving on to the next.

It is notable that the prediction modes 2-34 sample an angular rangefrom 45 degrees to 225 degrees; that is to say, one diagonal half of asquare. This is useful in the case of the 4:2:0 scheme, which as notedabove only uses square chroma PUs for intra-picture prediction.

4:2:2 Intra-Prediction Variants

However, also as noted above the 4:2:2 scheme could have rectangular(non-square) chroma PUs even when the luma PUs are square. Or indeed,the opposite could be true: a rectangular luma PU could correspond to asquare chroma PU. The reason for the discrepancy is that in 4:2:2, thechroma is subsampled horizontally (relative to the luma) but notvertically. So the aspect ratio of a luma block and a correspondingchroma block would be expected to be different. Accordingly the 4:2:2format represents one example (and there are other examples such as4:2:0) of a video format in which the chrominance samples have a lowerhorizontal and/or vertical sampling rate than the luminance samples sothat the ratio of luminance horizontal resolution to chrominancehorizontal resolution is different to the ratio of luminance verticalresolution to chrominance vertical resolution so that a block ofluminance samples has a different aspect ratio to a corresponding blockof chrominance samples.

Consequently, in an embodiment of the present disclosure, for chroma PUshaving a different aspect ratio to the corresponding luma block, amapping table may be required for the direction. Assuming (for example)a 1-to-2 aspect ratio for rectangular chroma PUs, then for example mode18 (currently at an angle of 135 degrees) may be re-mapped to 123degrees. Alternatively selection of current mode 18 may be remapped to aselection of current mode 22, to much the same effect.

Hence more generally, for non-square PUs, a different mapping betweenthe direction of the reference sample and the selected intra predictionmode may be provided compared with that for square PUs.

More generally still, any of the modes, including the non-directionalmodes, may also be re-mapped based upon empirical evidence.

It is possible that such mapping will result in a many-to-onerelationship, making the specification of the full set of modesredundant for 4:2:2 chroma PUs. In this case, for example it may be thatonly 17 modes (corresponding to half the angular resolution) arenecessary. Alternatively or in addition, these modes may be angularlydistributed in a non-uniform manner.

Similarly, the smoothing filter used on the reference sample whenpredicting the pixel at the sample position may be used differently; inthe 4:2:0 scheme it is only used to smooth luma pixels, but not chromaones. However, in the 4:2:2 and 4:4:4 schemes this filter may also beused for the chroma PUs. In the 4:2:2 scheme, again the filter may bemodified in response to the different aspect ratio of the PU, forexample only being used for a subset of near horizontal modes. Anexample subset of modes is preferably 2-18 and 34, or more preferably7-14. In 4:2:2, smoothing of only the left column of reference samplesmay be carried out in embodiments of the disclosure.

In general terms, in embodiments to be described, a first predictiondirection is defined in relation to a first grid of a first aspect ratioin respect of a set of current samples to be predicted; and a directionmapping is applied to the prediction direction so as to generate asecond prediction direction defined in relation to a second grid of adifferent aspect ratio. The first prediction direction may be definedwith respect to a square block of luminance samples including a currentluminance sample; and the second prediction direction may be definedwith respect to a rectangular block of chrominance samples including acurrent chrominance sample.

These arrangements are discussed later in more detail.

4:4:4 Intra-Prediction Variants

In the 4:4:4 scheme, the chroma and luma PUs are the same size, and sothe intra-prediction mode for a chroma PU can be either the same as theco-located luma PU (so saving some overhead in the bit stream by nothaving to encode a separate mode), or alternatively, it can beindependently selected.

In this latter case therefore, in an embodiment of the presentdisclosure one may have 1, 2 or 3 different prediction modes for each ofthe PUs in a CU;

In a first example, the Y, Cb and Cr PUs may all use the sameintra-prediction mode.

In a second example, the Y PU may use one intra-prediction mode, and theCb and Cr PUs both use another independently selected intra-predictionmode.

In a third example, the Y, Cb and Cr PUs each use a respectiveindependently selected intra-prediction mode.

It will be appreciated that having independent prediction modes for thechroma channels (or each chroma channel) will improve the colourprediction accuracy. But this is at the expense of an additional dataoverhead to communicate the independent prediction modes as part of theencoded data.

To alleviate this, the selection of the number of modes could beindicated in the high-level syntax (e.g. at sequence, picture, or slicelevel). Alternatively, the number of independent modes could be derivedfrom the video format; for example, GBR could have up to 3, whilst YCbCrcould be restricted to up to 2.

In addition to independently selecting the modes, the available modesmay be allowed to differ from the 4:2:0 scheme in the 4:4:4 scheme.

For example as the luma and chroma PUs are the same size in 4:4:4, thechroma PU may benefit from access to all of the 35+LM_CHROMA+DM_CHROMAdirections available. Hence for the case of Y, Cb and Cr each havingindependent prediction modes, then the Cb channel could have access toDM_CHROMA & LM_CHROMA, whilst the Cr channel could have access toDM_CHROMA_Y, DM_CHROMA_Cb, LM_CHROMA_Y and LM_CHROMA_Cb, where thesereplace references to the Luma channel with references to the Y or Cbchroma channels.

Where the luma prediction modes are signalled by deriving a list of mostprobable modes and sending an index for that list, then if the chromaprediction mode(s) are independent, it may be necessary to deriveindependent lists of most probable modes for each channel.

Finally, in a similar manner to that noted for the 4:2:2 case above, inthe 4:4:4 scheme the smoothing filter used on the reference sample whenpredicting the pixel at the sample position may be used for chroma PUsin a similar manner to luma PUs. Currently, a [1,2,1] low-pass filtercan be applied to the reference samples prior to intra-prediction. Thisis only used for luma TUs when using certain prediction modes.

One of the intra-prediction modes available to chroma TUs is to base thepredicted samples on co-located luma samples. Such an arrangement isillustrated schematically in FIG. 19, which shows an array of TUs 1200(from a region of a source image) represented by small squares in theCb, Cr and Y channels, showing the special alignment between imagefeatures (schematically indicated by dark and light shaded boxes 1200)in the Cb and Y channels and in the Cr and Y channels. In this example,it is of benefit to force the chroma TUs to base their predicted sampleson co-located luma samples. However, it is not always the case thatimage features correspond between the three channels. In fact, certainfeatures may appear only in one or two of the channels, and in generalthe image content of the three channels may differ.

In embodiments of the disclosure, for Cr TUs, LM_Chroma could optionallybe based on co-located samples from the Cb channel (or, in otherembodiments, the dependence could be the other way around). Such anarrangement is shown in schematic form in FIG. 20. Here, spatiallyaligned TUs are illustrated between the Cr, Cb and Y channels. A furtherset of TUs labelled “source” is a schematic representation of the colourpicture as seen as a whole. The image features (a top left triangle anda lower right triangle) seen in the source image do not in factrepresent changes in the luminance, but only changes in chrominancebetween the two triangular regions. In this case, basing LM_Chroma forCr on the luminance samples would produce a poor prediction, but basingit on the Cb samples could give a better prediction.

The decision as to which LM_Chroma mode to be used can be made by thecontroller 343 and/or the mode selector 520, based on trial encoding ofdifferent options (including the option of basing LM_Chroma on theco-located luma or co-located chroma samples), with the decision as towhich mode to select being made by assessing a cost function, similar tothat described above, with respect to the different trial encodings.Examples of the cost function are noise, distortion, error rate or bitrate. A mode from amongst those subjected to trial encoding which givesthe lowest of any one or more of these cost functions is selected.

FIG. 21 schematically illustrates a method used to obtain referencesamples for intra-prediction in embodiments of the disclosure. Inviewing FIG. 21, it should be borne in mind that encoding is carried outaccording to a scanning pattern, so that in general terms encodedversions of the blocks above and to the left of a current block to beencoded are available to the encoding process. Sometimes samplesbelow-left or to the above-right are used, if they have been previouslycoded as part of other already-encoded TUs within the current LCU.Reference is made to FIG. 13 as described above, for example.

A shaded area 1210 represents a current TU, that is to say, a TU whichis currently being encoded.

In 4:2:0 and 4:2:2, the column of pixels immediately to the left of thecurrent TU does not contain co-located luminance and chrominance samplesbecause of horizontal subsampling. In other words, this is because the4:2:0 and 4:2:2 formats have half as many chrominance pixels asluminance pixels (in a horizontal direction), so not every luminancesample position has a co-sited chrominance sample. Therefore, althoughluminance samples may be present in the column of pixels immediately tothe left of the TU, chrominance samples are not present. Therefore, inembodiments of the disclosure, the column located two samples to theleft of the current TU is used to provide reference samples forLM_Chroma. Note that the situation is different in 4:4:4, in that thecolumn immediately to the left of the current TU does indeed containco-located luma and chroma samples. This column could therefore be usedto provide reference samples.

The reference samples are used as follows.

In the LM_Chroma mode, predicted chroma samples are derived fromreconstructed luma samples according to a linear relationship. So, ingeneral terms, it can be said that the predicted chrominance valueswithin the TU are given by:P _(C) =a+bP _(L)where P_(C) is a chrominance sample value, P_(L) is a reconstructedluminance sample value at that sample position, and a and b areconstants. The constants are derived for a particular block by detectingthe relationship between reconstructed luma samples and chroma samplesin the row just above that block and in the column just to the left ofthat block, these being sample positions which have already been encoded(see above).

In embodiments of the disclosure, the constants a and b are derived asfollows:a=R(P _(L) ′,P _(C)′)/R(P _(L) ′,P _(L)′)where R represents a linear (least squares) regression function, andP_(L)′ and P_(C)′ are luminance and chrominance samples respectivelyfrom the adjacent row and column as discussed above, and:b=mean(P _(C)′)−a·mean(P _(L)′)

For 4:4:4, the P_(L)′ and P_(C)′ values are taken from the columnimmediately to the left of the current TU, and the row immediately abovethe current TU. For 4:2:2, the P_(L)′ and P_(C)′ values are taken fromthe row immediately above the current TU and the column in the adjacentblock which is two sample positions away from the left edge of thecurrent TU. For 4:2:0 (which is subsampled vertically and horizontally)the P_(L)′ and P_(C)′ values would ideally be taken from a row which istwo rows above the current TU, but in fact are taken from a row in theadjacent block which is one sample positions above the current TU, andthe column in the adjacent block which is two sample positions away fromthe left edge of the current TU. The reason is to avoid having tomaintain an additional whole row of data in memory. So in this regard,4:2:2 and 4:2:0 are treated in a similar way.

Accordingly, these techniques apply to video coding methods having achrominance prediction mode in which a current block of chrominancesamples representing a region of the image is encoded by deriving andencoding a relationship of the chrominance samples with respect to aco-sited block of luminance samples (such as reconstructed luminancesamples) representing the same region of the image. The relationship(such as the linear relationship) is derived by comparing co-sited(otherwise expressed as correspondingly-sited) luminance and chrominancesamples from adjacent already-encoded blocks. The chrominance samplesare derived from luminance samples according to the relationship; andthe difference between the predicted chrominance samples and the actualchrominance samples is encoded as residual data.

In respect of a first sampling resolution (such as 4:4:4) where thechrominance samples have the same sampling rate as the luminancesamples, the co-sited samples are samples in sample positions adjacentto the current block.

In respect of a second sampling resolution (such as 4:2:2 or 4:2:0)where the chrominance samples have a lower sampling rate than that ofthe luminance samples, a nearest column or row of co-sited luminance andchrominance samples from the adjacent already-encoded block is used toprovide the co-sited samples. Or where, in the case of the secondsampling resolution being a 4:2:0 sampling resolution, thecorrespondingly-sited samples are a row of samples adjacent to thecurrent block and a nearest column or row of correspondingly-sitedluminance and chrominance samples, from the adjacent already-encodedblocks.

FIG. 22 schematically illustrates the available prediction angles forluma samples. The current pixel being predicted as shown at the centreof the diagram as a pixel 1220. The smaller dots 1230 represent adjacentpixels. Those located on the top or left sides of the current pixel areavailable as reference samples to generate a prediction, because theyhave been previously encoded. Other pixels are currently unknown (at thetime of predicting the pixel 1220) and will in due course be predictedthemselves.

Each numbered prediction direction points to reference samples 1230 fromwithin a group of candidate reference samples on the top or left edgesof the current block that are used to generate the current predictedpixel. In the case of smaller blocks, where the prediction directionspoint to locations between reference samples, a linear interpolationbetween adjacent reference samples (either side of the sample positionpointed to by the direction indicated by the current prediction mode) isused.

Turning now to intra-angular prediction for chroma samples, for 4:2:0,fewer prediction directions are available because of the relativescarcity of the chroma samples. However, if the DM_CHROMA mode isselected then the current chroma block will use the same predictiondirection as the co-located luma block. In turn, this means that theluma directions for intra-prediction are also available to chroma.

However, for chroma samples in 4:2:2, it can be consideredcounter-intuitive to use the same prediction algorithm and direction asluma when DM_CHROMA is selected, given that chroma blocks now have adifferent aspect ratio to that of the luma blocks. For example, a 45°line for a square luma array of samples should still map to a 45° linefor chroma samples, albeit with an array of rectangular sized samples.Overlaying the rectangular grid onto to a square grid indicates that the45° line would then in fact map to a 26.6° line.

In embodiments of the disclosure, it may be defined that all regions ofan image, or all regions of each image, use the same prediction mode(for example, for at least chrominance samples), such as DM_CHROMA mode.

FIG. 23 schematically illustrates luma intra-prediction directions asapplied to chroma pixels in 4:2:2, in respect of a current pixel to bepredicted 1220. Note that there are half as many pixels horizontally asthere are vertically, because 4:2:2 has half the horizontal sample ratein the chroma channel as compared to the luma channel.

FIG. 24 schematically illustrates the transformation or mapping of the4:2:2 chroma pixels to a square grid, and subsequently how thistransformation changes the prediction directions.

The luma prediction directions are shown as broken lines 1240. Thechroma pixels 1250 are remapped to a square grid giving a rectangulararray half the width 1260 of the corresponding luma array (such as thatshown in FIG. 22). The prediction directions shown in FIG. 23 have beenremapped to the rectangular array. It can be seen that for some pairs ofdirections (a pair being a luma direction and a chroma direction) thereis either an overlap or a close relationship. For example, direction 2in the luma array substantially overlies the direction 6 in the chromaarray. However, it will also be noted that some luma directions,approximately half of them, have no corresponding chroma direction. Anexample is the luma direction numbered 3. Also, some chroma directions(2-5) have no equivalent in the luma array, and some luma directions(31-34) have no equivalent in the chroma array. But in general, thesuperposition as shown in FIG. 24 demonstrates that it would beinappropriate to use the same angle for both the luma and chromachannels.

FIG. 33 schematically illustrates an arrangement (which may beimplemented as part of the function of the controller 343) for modifyingan “angle step” defining a prediction direction. In FIG. 33, an anglestep is supplied to a modifier 1500 which, by making use of supportingdata 1510 such as a look-up table, indexed by an input angle step.mapping input angle steps to output angle steps, or data defining apredetermined modification algorithm or function, maps the directiondefined by the input angle step onto a direction defined by the outputangle step.

But before discussing the operation of FIG. 33 in detail, some furtherbackground on the derivation of prediction angles, and particularly“angle steps”, will be provided.

As discussed above, in an intra-prediction operation, samples within acurrent block may be predicted from one or more reference samples. Theseare selected from a group of candidate reference samples forming a rowabove the current block 1560 and a column to the left of the currentblock. FIG. 33 schematically illustrates such a row 1520 and column 1530of candidate reference samples.

Within the candidate reference samples, the actual sample to be used fora particular prediction operation is pointed to by the predictiondirection. This is expressed as an “angle step”. For a predominantlyvertical prediction direction (which in this context is one which willaddress a reference sample in the row 1520), the angle step is an offsetto the left or right of a sample position 1540 which is displacedvertically above the position 1550 of a current sample being predicted.For a predominantly horizontal prediction direction (which in thiscontext is one which will address a reference sample in the column1530), the angle step is an offset above or below a sample position 1570which is displaced horizontally to the left of the current sampleposition 1550.

It will therefore be understood that the angle step may be zero (in thecase of a pure horizontal or a pure vertical prediction direction), ormay represent a displacement in either sense (up/down/left/right).

In fact, for the purposes of calculation within embodiments of thedisclosure, the column 1530 and row 1520 may be considered as a singleordered linear array providing a set of candidate reference samples,starting from the bottom of the column 1530 and progressing to theright-end of the row 1520. In embodiments of the disclosure the lineararray is filtered (by a filter, forming part of the predictor 530) so asto apply a smoothing or low-pass filtering operation along the lineararray. An example of a suitable smoothing filter is a normalized 1-2-1filter, which is to say that the filter replaces a particular sample(only for the purposes of acting as a reference sample) by the sum of ¼of the sample to the left (in the linear array), ½ of that sample and ¼of the sample to the right (in the linear array). The smoothing filtercan be applied to all of the array or to a subset of the array (such asthe samples originating from the row or the column)

In order to derive the appropriate prediction angle for chroma when (a)DM_CHROMA is selected and (b) the DM_CHROMA mode currently in useindicates that the chroma prediction direction should be that of theco-located luma block, the following procedure is applied by themodifier 1500 to modify the angle step values. Note that the procedurerefers to the inverse of the angle step. This value can be used as aconvenient feature of the calculations carried out to generate aprediction, but it is the variation of the angle step which issignificant to the present discussion.

(i) derive the intra-prediction angle step (and, optionally, itsinverse) according to the luma direction

(ii) if the luma direction is predominantly vertical (that is, forexample, a mode numbered from 18 to 34 inclusive) then theintra-prediction angle step is halved (and its inverse is doubled).

(iii) otherwise, if the luma direction is predominantly horizontal (thatis, for example, a mode numbered from 2 to 17 inclusive) then theintra-prediction angle step is doubled (and its inverse halved).

These calculations represent an example of the application by themodifier 1500 of a predetermined algorithm to modify the angle stepvalues, in order to map a direction derived in respect of a luma grid ofsample positions onto a direction applicable to a 4:2:2 or othersubsampled chroma grid of sample positions. A similar outcome could beobtained by the modifier 1500 referring instead to a look-up tablemapping input angle steps to output angle steps.

Accordingly, in these embodiments the prediction direction defines asample position relative to a group of candidate reference samplescomprising a horizontal row and a vertical column of samplesrespectively disposed above and to the left of the set of currentsamples to be predicted. The predictor 530 implements a filteringoperation which, as discussed above, orders the group of candidatereference samples as a linear array of reference samples; and applies asmoothing filter to the linear array reference samples in a directionalong the linear array.

The process of carrying out the mapping can be carried out, for example,with respect to angle steps, in which a prediction direction for acurrent sample is defined with an associated angle step; the angle stepfor a predominantly vertical prediction direction is an offset along thehorizontal row of sample positions of the group of candidate referencesamples, relative to a sample position in that row which is verticallydisplaced from the current sample; the angle step for a predominantlyhorizontal prediction direction is an offset along the vertical columnof sample positions of the group of candidate reference samples,relative to a sample position in that column which is horizontallydisplaced from the current sample; and the sample position along thehorizontal row or vertical column indicated by the offset provides apointer to a sample position to be used in prediction of the currentsample.

In some embodiments, the step of applying the direction mapping cancomprise applying a predetermined function to the angle stepcorresponding to the first prediction direction. An example of such afunction is that described above, namely:

deriving an angle step according to the first prediction direction; and

(i) if the first prediction direction is predominantly vertical thenhalving the respective angle step to generate an angle step of thesecond prediction direction; or

(ii) if the first prediction direction is predominantly horizontal thendoubling the respective angle step to generate an angle step of thesecond prediction direction.

In embodiments of the disclosure, if the angle step (such as themodified step as derived above) is not an integer, the angle step isused to define a group of two or more samples positions within the groupof candidate reference samples (for example, the two samples either sideof the position pointed to by that direction) for interpolation toprovide a prediction of the current sample.

In other embodiments of the disclosure the step of applying thedirection mapping comprises using the first prediction direction toindex a look-up table, the table providing corresponding values of thesecond prediction direction.

According to embodiments of the disclosure, the step of detecting thefirst prediction direction can comprise: in the case of an encodingoperation, selecting a prediction direction according to a trial of twoor more candidate prediction directions; or in the case of a decodingoperation, detecting information defining a prediction directionassociated with the video data to be decoded. This is a general pointdistinguishing embodiments of coding and decoding systems: in a decoder,certain parameters are provided in eth encoded data or associated withit. In an encoder, such parameters are generated for communication withthe encoded data to the decoder.

In embodiments of the disclosure, the first prediction direction is usedfor prediction of luminance samples of a set of samples; and the secondprediction direction derived by the applying step from that firstprediction direction is used for prediction of chrominance samples ofthat set of samples.

Embodiments of the disclosure can provide a video coding or decodingmethod in which luminance and first and second chrominance componentsamples are predicted according to a prediction mode associated with asample to be predicted, the method comprising predicting samples of thesecond chrominance component from samples of the first chrominancecomponent.

Embodiments of the disclosure can provide a video coding or decodingmethod in which sets of samples are predicted from other respectivereference samples according to a prediction direction associated with asample to be predicted, the prediction direction defining a sampleposition, relative to a group of candidate reference samples disposedrelative to the set of current samples to be predicted, the methodcomprising:

ordering the group of candidate reference samples as a linear array ofreference samples; and

applying a smoothing filter to a subset of the linear array of referencesamples in a direction along the linear array.

Embodiments of the disclosure can provide a video coding or decodingmethod in which luminance and chrominance samples of an image arepredicted from other respective reference samples derived from the sameimage according to a prediction direction associated with a sample to bepredicted, the chrominance samples having a lower horizontal and/orvertical sampling rate than the luminance samples so that the ratio ofluminance horizontal resolution to chrominance horizontal resolution isdifferent to the ratio of luminance vertical resolution to chrominancevertical resolution so that a block of luminance samples has a differentaspect ratio to a corresponding block of chrominance samples, thechrominance samples representing first and second chrominancecomponents;

the method comprising:

selecting a prediction mode defining a selection of one or morereference samples or values for predicting a current chrominance sampleof the first chrominance component; and

selecting a different prediction mode defining a different selection ofone or more reference samples or values for predicting a currentchrominance sample of the second chrominance component, co-sited withthe current chrominance sample of the first chrominance component.

Embodiments of the disclosure can provide a video coding or decodingmethod in which luminance and chrominance samples are predicted fromother respective reference samples according to a prediction directionassociated with a sample to be predicted, the chrominance samples havinga lower horizontal and/or vertical sampling rate than the luminancesamples so that the ratio of luminance horizontal resolution tochrominance horizontal resolution is different to the ratio of luminancevertical resolution to chrominance vertical resolution so that a blockof luminance samples has a different aspect ratio to a correspondingblock of chrominance samples; the method comprising:

applying a different respective prediction algorithm to the luminanceand chrominance samples in dependence upon the difference in aspectratio.

FIG. 33 shows an example of this technique in use. An angle step 1580 isderived according to the luma grid. (It is possible that it is also usedin respect of the luma sample prediction, but it is enough for thepresent discussion that it is derived according to the luma grid andprocedures. In other words, it may not in fact be used for lumaprediction). An array of 4:2:2 chroma samples 1580 are shown as beingdouble-width on the same grid; but using the same prediction direction1590 points to a different reference sample (a different offset from thevertically located sample 1540) in such a case. Therefore, the anglestep is modified according to the procedure set out above so as toprovide a modified angle step 1600 which points to the correct chromareference sample to represent the same prediction direction in thechroma grid.

Accordingly these embodiments of the present disclosure relate to videocoding or decoding methods, apparatus or programs in which luminance andchrominance samples are predicted from other respective referencesamples according to a prediction direction associated with a currentsample to be predicted. In modes such as 4:2:2 the chrominance sampleshave a lower horizontal and/or vertical sampling rate than the luminancesamples so that the ratio of luminance horizontal resolution tochrominance horizontal resolution is different to the ratio of luminancevertical resolution to chrominance vertical resolution. In short, thismeans that a block of luminance samples has a different aspect ratio toa corresponding block of chrominance samples.

The intra frame predictor 530, for example, is operable as a detector todetect a first prediction direction defined in relation to a first gridof a first aspect ratio in respect of a set of current samples to bepredicted; and as a direction mapper to apply a direction mapping to theprediction direction so as to generate a second prediction directiondefined in relation to a second grid of a different aspect ratio.Accordingly, the predictor 530 represents an example of a directionmapper. The predictor 540 may provide another corresponding example.

In embodiments of the disclosure, the first grid, used to detect thefirst prediction direction, is defined in respect of sample positions ofone of luminance or chrominance samples, and the second grid, used todetect the second prediction direction, is defined in respect of samplespositions of the other of luminance or chrominance samples. In theparticular examples discussed in the present description, the luminanceprediction direction may be modified to provide the chrominanceprediction direction. But the other way round could be used.

The technique is particularly applicable to intra-prediction, so thatthe reference samples are samples derived from (for example,reconstructed from compressed data derived from) the same respectiveimage as the samples to be predicted.

In at least some arrangements the first prediction direction is definedwith respect to a square block of luminance samples including thecurrent luminance sample; and the second prediction direction is definedwith respect to a rectangular block of chrominance samples including thecurrent chrominance sample.

It is possible to provide independent prediction modes for the twochrominance components. In such an arrangement the chrominance samplescomprise samples of first and second chrominance components, and thetechnique comprises applying the direction mapping discussed above stepin respect of the first chrominance component (such as Cb); andproviding a different prediction mode in respect of the secondchrominance component (such as Cr), which may (for example) involvepredicting the second chrominance component from samples of the firstchrominance component.

The video data can be in a 4:2:2 format, for example.

In the case of a decoder or decoding method, the prediction directionsmay be detected by detecting data defining the prediction directions inthe encoded video data.

In general terms, embodiments of the disclosure can provide forindependent prediction modes for the chrominance components (forexample, for each of the luminance and chrominance componentsseparately). These embodiments relate to video coding methods in whichluminance and chrominance samples of an image are predicted from otherrespective reference samples derived from the same image according to aprediction direction associated with a sample to be predicted, thechrominance samples having a lower horizontal and/or vertical samplingrate than the luminance samples so that the ratio of luminancehorizontal resolution to chrominance horizontal resolution is differentto the ratio of luminance vertical resolution to chrominance verticalresolution so that a block of luminance samples has a different aspectratio to a corresponding block of chrominance samples, and thechrominance samples representing first and second chrominancecomponents.

The intra frame mode selector 520 selects a prediction mode defining aselection of one or more reference samples for predicting a currentchrominance sample of the first chrominance component (such as Cb). Italso selects a different prediction mode defining a different selectionof one or more reference samples for predicting a current chrominancesample of the second chrominance component (such as Cr), co-sited withthe current chrominance sample of the first chrominance component.

A reference sample filter can optionally be applied to horizontalsamples or vertical samples (or both). As discussed above, the filtercan be a 3-tap normalized “1 2 1” filter, currently applied to all lumareference samples except the bottom left and top right (the samples of aN×N block are gathered together to form a single 1D array of size 2N+1,and then optionally filtered). In embodiments of the disclosure it isapplied only the first (left hand edge) or last (top edge) N+1 chromasamples for 4:2:2, but noting that the bottom left, top right and topleft would then not be adjusted; or all chroma samples (as for luma),for 4:2:2 and 4:4:4.

Embodiments of the disclosure can also provide video coding or decodingmethods, apparatus or programs in which luminance and first and secondchrominance component samples are predicted (for example, from otherrespective reference samples or values) according to a prediction modeassociated with a sample to be predicted, involving predicting samplesof the second chrominance component from samples of the firstchrominance component. In some embodiments the prediction modeassociated with a sample to be predicted can indicate a predictiondirection defining one or more other respective reference samples fromwhich that sample is to be predicted.

Embodiments of the disclosure can also provide video coding or decodingmethods, apparatus or programs in which luminance and first and secondchrominance component samples are predicted from other respectivereference samples according to a prediction direction associated with asample to be predicted, involving filtering the reference samples.

As discussed with reference to FIGS. 19 and 20, it is possible that thedifferent prediction mode comprises a mode by which samples of thesecond chrominance component are predicted from samples of the firstchrominance component.

Note that modes 0 and 1 are not angular prediction modes and so are notincluded in this procedure. The effect of the procedure shown above isto map the chroma prediction directions onto the luma predictiondirections in FIG. 24.

For 4:2:0, when either a purely horizontal prediction mode (luma mode10) or a purely vertical prediction mode (luma mode 26) is selected, thetop or left edges of the predicted TU are subject to filtering for theluma channel only. For the horizontal prediction mode, the top row isfiltered in the vertical direction. For the vertical prediction mode,the left column is filtered in the horizontal direction.

Filtering a column of samples in the horizontal direction can beunderstood as applying a horizontally oriented filter to each sample inturn of the column of samples. So, for an individual sample, its valuewill be modified by the action of the filter, based on a filtered valuegenerated from the current value of that sample and of one or more othersamples at sample positions displaced from that sample in a horizontaldirection (that is, one or more other samples to the left and/or rightof the sample in question).

Filtering a row of samples in the vertical direction can be understoodas applying a vertically oriented filter to each sample in turn of therow of samples. So, for an individual sample, its value will be modifiedby the action of the filter, based on a filtered value generated fromthe current value of that sample and of one or more other samples atsample positions displaced from that sample in a vertical direction(that is, one or more other samples above and/or below the sample inquestion).

One purpose of the edge pixel filtering process described above is toaim to reduce block based edge effects in the prediction thereby aimingto reduce energy in the residual image data.

In embodiments of the disclosure, a corresponding filtering process isalso provided for chroma TUs in 4:4:4 and 4:2:2. Taking into account thehorizontal subsampling, one proposal is only to filter the top row ofthe chroma TU in 4:2:2, but to filter both the top row and left column(as appropriate, according to the selected mode) in 4:4:4. It isconsidered appropriate to filter only in these regions so as to avoidfiltering out too much useful detail, which (if filtered out) would leadto an increased energy of the residual data.

For 4:2:0, when DC mode is selected, the top and/or left edges of thepredicted TU are subject to filtering for the luma channel only.

The filtering may be such that in DC Mode, the filter does a(1×neighbouring outside sample+3*edge sample)/4 averaging operation forall samples on both edges. However, for the top left the filter functionis (2×current sample+1×above sample+1×left sample)/4.

The H/V filter is an average between neighbouring outside sample andedge sample.

In embodiments of the disclosure, this filtering process is alsoprovided for chroma TUs in 4:4:4 and 4:2:2. Again, taking into accountthe horizontal subsampling, in some embodiments of the disclosure, onlythe top row of the chroma samples is filtered for 4:2:2, but the top rowand left column of the chroma TU are filtered for 4:4:4.

Accordingly, this technique can apply in respect of a video coding ordecoding method, apparatus or program in which luminance and chrominancesamples in a 4:4:4 format or a 4:2:2 format are predicted from otherrespective samples according to a prediction direction associated withblocks of samples to be predicted.

In embodiments of the technique, a prediction direction is detected inrespect of a current block to be predicted. A predicted block ofchrominance samples is generated according to other chrominance samplesdefined by the prediction direction. If the detected predictiondirection is substantially vertical (for example, being within +/−nangle modes of the exactly vertical mode where n is (for example) 2),the left column of samples is filtered (for example, in a horizontaldirection) in the predicted block of chrominance samples. Or, if thedetected prediction direction is substantially horizontal (for example,being within +/−n angle modes of the exactly horizontal mode, where n is(for example) 2), the top row of samples is filtered (for example, in avertical direction) in the predicted block of chrominance samples. Thenthe difference between the filtered predicted chrominance block and theactual chrominance block is encoded, for example as residual data.Alternatively, the test could be for an exactly vertical or horizontalmode rather than a substantially vertical or horizontal mode. Thetolerance of +/−n could be applied to one of the tests (vertical orhorizontal) but not the other.

Inter-Prediction

It is noted that inter prediction in HEVC already allows rectangularPUs, so 4:2:2 and 4:4:4 modes are already compatible with PUinter-prediction processing.

Each frame of a video image is a discrete sampling of a real scene, andas a result each pixel is a step-wise approximation of a real-worldgradient in colour and brightness.

In recognition of this, when predicting the Y, Cb or Cr value of a pixelin a new video frame from a value in a previous video frame, the pixelsin that previous video frame are interpolated to create a betterestimate of the original real-world gradients, to allow a more accurateselection of brightness or colour for the new pixel. Consequently themotion vectors used to point between video frames are not limited to aninteger pixel resolution. Rather, they can point to a sub-pixel positionwithin the interpolated image.

4:2:0 Inter-Prediction

Referring now to FIGS. 25 and 26, in the 4:2:0 scheme as noted abovetypically an 8×8 luma PU 1300 will be associated with Cb and Cr 4×4chroma PUs 1310. Consequently to interpolate the luma and chroma pixeldata up to the same effective resolution, different interpolationfilters are used.

For example for the 8×8 4:2:0 luma PU, interpolation is ¼ pixel, and soan 8-tap×4 filter is applied horizontally first, and then the same8-tap×4 filter is applied vertically, so that the luma PU is effectivelystretched 4 times in each direction, to form an interpolated array 1320as shown in FIG. 25. Meanwhile the corresponding 4×4 4:2:0 chroma PU is⅛ pixel interpolated to generate the same eventual resolution, and so a4-tap×8 filter is applied horizontally first, then the same 4-tap×8filter is applied vertically, so that the 4:2:0 chroma PUs areeffectively stretched 8 times in each direction to form an array 1330,as shown in FIG. 26.

4:2:2 Inter-Prediction

A similar arrangement for 4:2:2 will now be described with reference toFIGS. 27 and 28, which illustrate a luma PU 1350 and a pair ofcorresponding chroma PUs 1360.

Referring to FIG. 28, as noted previously, in the 4:2:2 scheme thechroma PU 1360 can be non-square, and for the case of an 8×8 4:2:2 lumaPU, will typically be a 4 wide×8 high 4:2:2 Chroma PU for each of the Cband Cr channels. Note that the chroma PU is drawn, for the purposes ofFIG. 28, as a square shaped array of non-square pixels, but in generalterms it is noted that the PUs 1360 are 4 (horizontal)×8 (vertical)pixel arrays.

Whilst it may be possible therefore to use the existing 8-tap×4 lumafilter vertically on the chroma PU, in an embodiment of the presentdisclosure it has been appreciated that the existing 4-tap×8 chromafilter would suffice for vertical interpolation as in practice one isonly interested in the even fractional locations of the interpolatedchroma PU.

Hence FIG. 27 shows the 8×8 4:2:2 luma PU 1350 interpolated as beforewith an 8-tap×4 filter, and the 4×8 4:2:2 chroma PUs 1360 interpolatedwith the existing 4-tap×8 chroma filter in the horizontal and verticaldirection, but only with the even fractional results used for formingthe interpolated image in the vertical direction.

These techniques are applicable to video coding or decoding methods,apparatus or programs using inter-image prediction to encode input videodata in which each chrominance component has 1/Mth of the horizontalresolution of the luminance component and 1/Nth of the verticalresolution of the luminance component, where M and N are integers equalto 1 or more, For example, For 4:2:2, M=2, N=1. For 4:2:0, M=2, N=2.

The frame store 570 is operable to store one or more images preceding acurrent image.

The interpolation filter 580 is operable to interpolate a higherresolution version of prediction units of the stored images so that theluminance component of an interpolated prediction unit has a horizontalresolution P times that of the corresponding portion of the stored imageand a vertical resolution Q times that of the corresponding portion ofthe stored image, where P and Q are integers greater than 1. In thecurrent examples, P=Q=4 so that the interpolation filter 580 is operableto generate an interpolated image at ¼ sample resolution.

The motion estimator 550 is operable to detect inter-image motionbetween a current image and the one or more interpolated stored imagesso as to generate motion vectors between a prediction unit of thecurrent image and areas of the one or more preceding images.

The motion compensated predictor 540 is operable to generate a motioncompensated prediction of the prediction unit of the current image withrespect to an area of an interpolated stored image pointed to by arespective motion vector.

Returning to a discussion of the operation of the interpolation filter580, embodiments of this filter are operable to apply applying a xRhorizontal and xS vertical interpolation filter to the chrominancecomponents of a stored image to generate an interpolated chrominanceprediction unit, where R is equal to (U×M×P) and S is equal to (V×N×Q),U and V being integers equal to 1 or more; and to subsample theinterpolated chrominance prediction unit, such that its horizontalresolution is divided by a factor of U and its vertical resolution isdivided by a factor of V, thereby resulting in a block of MP×NQ samples.

So, in the case of 4:2:2, the interpolation filter 580 applies a ×8interpolation in the horizontal and vertical directions, but thenvertically subsamples by a factor of 2, for example by using every2^(nd) sample in the interpolated output.

This technique therefore allows the same (for example, ×8) filter to beused in respect of 4:2:0 and 4:2:2, but with a further step ofsubsampling where needed with 4:2:2.

In embodiments of the disclosure, as discussed, the interpolatedchrominance prediction unit has a height in samples twice that of a4:2:0 format prediction unit interpolated using the same xR and xSinterpolation filters.

The need to provide different filters can be avoided or alleviated usingthese techniques, and in particular by using the same xR horizontal andxS vertical interpolation filters, in respect of 4:2:0 input video dataand 4:2:2 input video data.

As discussed, the step of subsampling the interpolated chrominanceprediction unit comprises using every Vth sample of the interpolatedchrominance prediction unit in the vertical direction, and/or usingevery Uth sample of the interpolated chrominance prediction unit in thevertical direction.

Embodiments of the disclosure can involve deriving a luminance motionvector for a prediction unit; and independently deriving one or morechrominance motion vectors for that prediction unit.

In embodiments of the disclosure, at least one of R and S is equal to 2or more, and in embodiments of the disclosure the xR horizontal and xSvertical interpolation filters are also applied to the luminancecomponents of the stored image.

4:4:4 Inter-Prediction Variants

By extension, the same principle of only using the even fractionalresults for the existing 4-tap×8 chroma filter can be applied bothvertically and horizontally for the 8×8 4:4:4 chroma PUs.

Further to these examples, the ×8 chroma filter may be used for allinterpolation, including luma.

Further Inter-Prediction Variants

In one implementation of motion vector (MV) derivation, one vector isproduced for a PU in a P-slice (and two vectors for a PU in a B-slice(where a P-slice takes predictions from a preceding frame, and a B-slicetakes predictions from a preceding and following frame, in a similarmanner to MPEG P and B frames). Notably, in this implementation in the4:2:0 scheme the vectors are common to all channels, and moreover, thechroma data need not be used to calculate the motion vectors. In otherwords, all the channels use a motion vector based on the luma data.

In an embodiment of the present disclosure, in the 4:2:2 scheme thechroma vector could be derived so as to be independent from luma (i.e. asingle vector for the Cb and Cr channels could be derived separately),and in the 4:4:4 scheme chroma vectors could further be independent foreach of the Cb and Cr channels.

Embodiments of the disclosure can provide a video coding or decodingmethod in which luminance and chrominance samples of an image arepredicted from other respective reference samples derived from the sameimage according to a prediction mode associated with a sample to bepredicted, the chrominance samples representing first and secondchrominance components; the method comprising: selecting, for at leastsome samples, the same prediction mode for each of the luminance andchrominance components corresponding to an image region.

Embodiments of the disclosure can provide a video coding or decodingmethod in which luminance and chrominance samples of an image arepredicted from other respective reference samples derived from the sameimage according to a prediction mode associated with a sample to bepredicted, the chrominance samples representing first and secondchrominance components; the method comprising: selecting, for at leastsome samples, different respective prediction modes for each of theluminance and chrominance components corresponding to an image region.

In either case, either the same prediction mode or different respectiveprediction modes can be used for each of the luminance and chrominancecomponents corresponding to an image region, the selection being madeaccording to an image sequence, an image, or a region of an image.

To select a prediction mode scheme in an encoding operation, theembodiments can for example carry out a first trial encoding of an imageregion using the same prediction mode for the luminance and chrominancecomponents; carry out a second trial encoding of that image region usingdifferent respective prediction modes for the luminance and chrominancecomponents; and select either the same prediction mode or differentrespective prediction modes for use in respect of a picture sequence, apicture, or a region of a picture on the basis of the data encoded bythe first and second trial encodings.

The processing of the trial results can, in embodiments of thedisclosure, involve detecting one or more predetermined properties ofthe data encoded by the first and second trial encodings; and selectingeither the same prediction mode or different respective prediction modesfor use in respect of a picture sequence, a picture, or a region of apicture on the basis of the detected one or more properties. The one ormore properties can, for example, comprise properties selected from theset consisting of: image noise; image distortion; and image dataquantity. The selection can be made for individual image slices or imageblocks. Embodiments of the disclosure are operable to associateinformation with the encoded video signal (for example, as part of theencoded data stream, as one or more data flags within the data stream)indicating: whether the same prediction modes or different predictionmodes are used; and in the case that the same prediction mode is used,an identification of that single prediction mode; or in the case thatdifferent respective prediction modes are used, an identification ofthose different respective prediction modes, for example using thenumbering scheme discussed in this application in respect of predictionmodes.

For embodiments carrying out a decoding operation, the method maycomprise: detecting information associated with video data for decoding,the information defining whether the same prediction mode or differentprediction modes are associated with the video data for decoding. Ifsuch information (for example, a one-bit flag at a predeterminedposition with respect to the data stream) indicates that the sameprediction modes are used, the decoder applies the prediction modeinformation defined in respect of one component (such as luma) to thedecoding of the other components (such as chroma). Otherwise, thedecoder applies the individually specified prediction modes to eachcomponent.

In embodiments of the disclosure, as discussed, the image forms part ofa 4:2:2 or a 4:4:4 video signal.

Transforms

In HEVC, most images are encoded as motion vectors from previouslyencoded/decoded frames, with the motion vectors telling the decoderwhere, in these other decoded frames, to copy good approximations of thecurrent image from. The result is an approximate version of the currentimage. HEVC then encodes the so-called residual, which is the errorbetween that approximate version and the correct image. This residualrequires much less information than specifying the actual imagedirectly. However, it is still generally preferable to compress thisresidual information to reduce the overall bitrate further.

In many encoding methods including HEVC, such data is transformed intothe spatial frequency domain using an integer cosine transform (ICT),and typically some compression is then achieved by retaining low spatialfrequency data and discarding higher spatial frequency data according tothe level of compression desired.

4:2:0 Transforms

The spatial frequency transforms used in HEVC are conventionally onesthat generate coefficients in powers of 4 (for example 64 frequencycoefficients) as this is particularly amenable to commonquantisation/compression methods. The square TUs in the 4:2:0 scheme areall powers of 4 and hence this is straightforward to achieve.

If the NSQT options are enabled, some non-square transforms areavailable for non-square TUs, such as 4×16, but again notably theseresult in 64 coefficients, i.e. again a power of 4.

4:2:2 and 4:4:4 Transform Variants

The 4:2:2 scheme can result in non-square TUs that are not powers of 4;for example a 4×8 TU has 32 pixels, and 32 is not a power of 4.

In an embodiment of the present disclosure therefore, a non-squaretransform for a non-power of 4 number of coefficients may be used,acknowledging that modifications may be required to the subsequentquantisation process.

Alternatively, in an embodiment of the present disclosure non-square TUsare split into square blocks having a power of 4 area fortransformation, and then the resulting coefficients can be interleaved.

For example, for 4×8 blocks odd/even vertical samples can be split intotwo square blocks. Alternatively, for 4×8 blocks the top 4×4 pixels andthe bottom 4×4 pixels could form two square blocks. Alternatively again,for 4×8 blocks a Haar wavelet decomposition can be used to form a lowerand an upper frequency 4×4 block.

Any of these options may be made available, and the selection of aparticular alternative may be signalled to or derived by the decoder.

Other Transform Modes

In the 4:2:0 scheme there is a proposed flag (the so-called‘qpprime_y_zero_transquant_bypass_flag’) allowing the residual data tobe included in the bit stream losslessly (i.e. without beingtransformed, quantised or further filtered). In the 4:2:0 scheme theflag applies to all channels.

Accordingly, such embodiments represent a video coding or decodingmethod, apparatus or program in which luminance and chrominance samplesare predicted and the difference between the samples and the respectivepredicted samples is encoded, making use of an indicator configured toindicate whether luminance difference data is to be included in anoutput bitstream losslessly; and to independently indicate whetherchrominance difference data is to be included in the bitstreamlosslessly.

In an embodiment of the present disclosure, it is proposed that the flagfor the luma channel is separate to the chroma channels. Hence for the4:2:2 scheme, such flags should be provided separately for the lumachannel and for the chroma channels, and for the 4:4:4 scheme, suchflags should be provided either separately for the luma and chromachannels, or one flag is provided for each of the three channels. Thisrecognises the increased chroma data rates associated with the 4:2:2 and4:4:4 schemes, and enables, for example, lossless luma data togetherwith compressed chroma data.

For intra-prediction coding, mode-dependent directional transform (MDDT)allows the horizontal or vertical ICT (or both ICTs) for a TU to bereplaced with an Integer Sine Transform depending upon theintra-prediction direction. In the 4:2:0 scheme this is not applied tochroma TUs. However in an embodiment of the present disclosure it isproposed to apply it to 4:2:2 and 4:4:4 chroma TUs, noting that the ISTis only currently defined for a 4 sample transform dimensions (eitherhorizontally or vertically), and therefore cannot currently be appliedvertically to a 4×8 chroma TU. MDDT will be discussed further below.

In methods of video coding, the various embodiments of the disclosurecan be arranged so as to indicate whether luminance difference data isto be included in an output bitstream losslessly; and independently toindicate whether chrominance difference data is to be included in thebitstream losslessly, and to encode or include the relevant data in theform defined by such indications.

Quantisation

In the 4:2:0 scheme, the quantisation calculation is the same forchrominance as for luminance. Only the quantisation parameters (QPs)differ.

QPs for chrominance are calculated from the luminance QPs as follows:Qp_(Cb)=scalingTable[Qp_(luminance)+chroma_qp_index_offset]Qp_(Cr)=scalingTable[Qp_(luminance)+second_chroma_qp_index_offset]

where the scaling table is defined as seen in FIG. 29a or 29 b (for4:2:0 and 4:2:2 respectively), and “chroma_qp_index_offset” and“second_chroma_qp_index_offset” are defined in the picture parameter setand may be the same or different for Cr and Cb. In other words, thevalue in square brackets defines in each case an “index” into thescaling table (FIG. 29a and FIG. 29b ) and the scaling table then givesa revised value of Qp (“value”).

Note that “chroma_qp_index_offset” and “second_chroma_qp_index_offset”may instead be referred to as cb_qp_offset and cr_qp_offsetrespectively.

Chrominance channels typically contain less information than luminanceand hence have smaller-magnitude coefficients; this limitation on thechrominance QP may prevent all chrominance detail being lost at heavyquantisation levels.

The QP-divisor relationship in the 4:2:0 is a logarithmic one such thatan increase of 6 in the QP is equivalent to a doubling of the divisor(the quantisation step size discussed elsewhere in this description,though noting that it may be further modified by Qmatrices before use).Hence the largest difference in the scaling table of 51−39=12 representsa factor-of-4 change in the divisor.

However, in an embodiment of the present disclosure, for the 4:2:2scheme, which potentially contains twice as much chroma information asthe 4:2:0 scheme, the maximum chrominance QP value in the scaling tablemay be raised to 45 (i.e. halving the divisor). Similarly for the 4:4:4scheme, the maximum chrominance QP value in the scaling table may beraised to 51 (i.e. the same divisor). In this case the scaling table isin effect redundant, but may be retained simply for operationalefficiency (i.e. so that the system works by reference to a table in thesame way for each scheme). Hence more generally in an embodiment of thepresent disclosure the chroma QP divisor is modified responsive to theamount of information in the coding scheme relative to the 4:2:0 scheme.

Accordingly, embodiments of the disclosure apply to a video coding ordecoding method operable to quantise blocks of frequency-transformedluminance and chrominance component video data in a 4:4:4 or a 4:2:2format according to a selected quantisation parameter which defines aquantisation step size. A quantisation parameter association (such as,for example, the appropriate table in FIG. 29a or 29 b) is definedbetween luminance and chrominance quantisation parameters, where theassociation is such that a maximum chrominance quantisation step size isless than a maximum luminance quantisation step size for the 4:2:2format (for example, 45) but equal to the maximum luminance quantisationstep size for the 4:4:4 format (for example, 51). The quantisationprocess operates in that each component of the frequency-transformeddata is divided by a respective value derived from the respectivequantisation step size, and the result is rounded to an integer value,to generate a corresponding block of quantised spatial frequency data.

It will be appreciated that the dividing and rounding steps areindicative examples of a generic quantising stage, according to therespective quantisation step size (or data derived from it, for exampleby the application of Qmatrices).

Embodiments of the disclosure include the step of selecting aquantisation parameter or index (QP for luminance) for quantising thespatial frequency coefficients, the quantisation parameter acting as areference to a respective one of a set of quantisation step sizesaccording to the QP tables applicable to luminance data. The process ofdefining the quantisation parameter association can then comprise: forchrominance components, referencing a table of modified quantisationparameters (such as the table of FIG. 29a or 29 b) according to theselected quantisation parameter, which in turn can involve (i) for thefirst chrominance component, adding a first offset (such aschroma_qp_index_offset) to the quantisation parameter and selecting themodified quantisation index corresponding to the entry, in the table,for the quantisation index plus the first offset; and (ii) for thesecond chrominance component, adding a second offset (such assecond_chroma_qp_index_offset) to the quantisation parameter andselecting the modified quantisation index corresponding to the entry, inthe table, for the quantisation index plus the second offset; andreferencing a respective quantisation step size in the set according tothe quantisation parameter for the luminance data and the first andsecond modified quantisation indices for the first and secondchrominance components. Viewed in a different way, this is an example ofa process involving selecting a quantisation parameter for quantisingthe spatial frequency coefficients, the quantisation parameter acting asa reference to a respective one of a set of quantisation step sizes; andin which the defining step comprises: for chrominance components,referencing a table of modified quantisation parameters according to theselected quantisation parameter, the referencing step comprising: foreach chrominance component, adding a respective offset to thequantisation parameter and selecting the modified quantisation parametercorresponding to the entry, in the table, for the quantisation parameterplus the respective offset; and referencing a respective quantisationstep size in the set according to the quantisation parameter for theluminance data and the first and second modified quantisation parametersfor the first and second chrominance components.

The techniques are particularly applicable to arrangements in whichsuccessive values of the quantisation step sizes in the set are relatedlogarithmically, so that a change in quantisation parameter of m (wherem is an integer) represents a change in quantisation step size by afactor of p (where p is an integer greater than 1). In the presentembodiments, m=6 and p=2.

In embodiments of the disclosure, as discussed above, a maximumluminance quantisation parameter is 51; a maximum chrominancequantisation parameter is 45 for the 4:2:2 format; and a maximumchrominance quantisation parameter is 51 for the 4:4:4 format.

In embodiments of the disclosure, the first and second offsets can becommunicated in association with the encoded video data.

In 4:2:0 the transform matrices A are initially created (by thetransform unit 340) from those of a true normalised N×N DCT A′ using:A _(ij) =int(64×√{square root over (N)}×A′ _(ij))where i and j indicate a position within the matrix. This scaling withrespect to a normalised transform matrix provides an increase inprecision, avoids the need for fractional calculations and increases theinternal precision.

Ignoring differences due to rounding of Aij, since X is multiplied byboth A and A^(T) (the transposition of the matrix A) the resultingcoefficients differ from those of a true normalised M×N (M=height;N=width) DCT by a common scaling factor of:(64×√{square root over (N)})(64×√{square root over (M)})=4096√{squareroot over (N)}√{square root over (M)}

Note that the common scaling factor could be different to this example.Note also that matrix multiplying by both A and A^(T) can be carried outin various ways, such as the so-called Butterfly method. The significantfact is whether the operation that is carried out is equivalent to atraditional matrix multiplication, not whether it is performed in aparticular traditional order of operations.

This scaling factor is equivalent to a binary left-shift bitwiseoperation by a number of bits transformShift, since in HEVC this resultsin a power of 2:transformShift=(12+0.5 log₂(N)+0.5 log₂(M))

To reduce the requirement on internal bit-precision, the coefficientsare right-shifted (using positive rounding) twice during the transformprocess:shift1=log₂(N)+bitDepth−9shift2=log₂(M)+6

As a result, the coefficients as they leave the forward transformprocess and enter the quantiser are effectively left-shifted by:

$\begin{matrix}{{resultingShift} = {( {12 + {0.5\;{\log_{2}({NM})}}} ) - ( {{{shift}\; 1} + {{shift}\; 2}} )}} \\{= {( {12 + {0.5\;{\log_{2}(N)}} + {0.5\;{\log_{2}(M)}}} ) -}} \\{( {{\log_{2}(N)} + {bitDepth} - 9 + {\log_{2}(M)} + 6} )} \\{= {15 - ( {{0.5\;{\log_{2}(N)}} + {0.5\;{\log_{2}(M)}} + {bitDepth}} )}}\end{matrix}$

In 4:2:0, the frequency separated (for example, DCT) coefficientsgenerated by the frequency transform are a factor of(2^(resultingShift)) larger than those that a normalised DCT wouldproduce.

In some embodiments of the disclosure, the blocks are either square orrectangular with a 2:1 aspect ratio. Therefore, for a block size of N×M,either:

N=M, in which case, resultingShift is an integer and S=N=M=sqrt(NM); or

0.5N=2M or 2N=0.5M, in which case resultingShift is still an integer andS=sqrt(NM)resultingShift=15−(0.5 log₂(N)+0.5log₂(M)+bitDepth)=15−(log₂(S)+bitDepth)

The coefficients are subsequently quantised, where the quantisingdivisor is derived according to the quantisation parameter QP.

Note that resultingShift is equivalent to an integer, so the commonscaling factor is an integer power of 2, the overall left-shift‘resultingShift’ of the transform process is also accounted for at thisstage by applying an equal but opposite right-shift,‘quantTransformRightShift’.

This bit-shift operation is possible because resultingShift is aninteger.

Also note that the divisor-QP (quantisation parameter or index)relationship follows a base-2 power curve, as mentioned above, in thatan increase in QP by 6 has the effect of doubling the divisor whereas anincrease in QP by 3 has the effect of increasing the divisor by a factorof sqrt(2) (square root of 2).

Due to the chroma format in 4:2:2, there are more TU width:height (N:M)ratios:

N=M (from before) where S=N=M=sqrt(NM) (resultingShift is an integer)

0.5N=2M and 2N=0.5M, (from before), where S=sqrt(NM) (resultingShift isan integer)

N=2M where S=sqrt(NM)

2M=N where S=sqrt(NM)

4N=0.5M where S=sqrt(NM)resultingShift=15−(log₂(S)+bitDepth)

In these latter three situations, resultingShift is not an integer. Forexample, this may apply where at least some of the blocks of video datasamples comprise M×N samples, where the square root of N/M is not equalto an integer power of 2. Such block sizes can occur in respect ofchroma samples in some of the present embodiments.

Accordingly, in such instances, the following techniques are relevant,that is to say, in video coding or decoding methods, apparatus orprograms operable to generate blocks of quantised spatial frequency databy performing frequency-transformation on blocks of video data samplesusing a transform matrix comprising an array of integer values which areeach scaled with respect to respective values of a normalized transformmatrix by an amount dependent upon a dimension of the transform matrix,and to quantise the spatial frequency data according to a selectedquantisation step size, having the step of frequency-transforming ablock of video data samples by matrix-multiplying the block by thetransform matrix and the transposition of the transform matrix togenerate a block of scaled spatial frequency coefficients which are eachlarger, by a common scaling factor (for example, resultingShift), thanthe spatial frequency coefficients which would result from a normalizedfrequency-transformation of that block of video data samples.

Therefore at the quantisation stage, an appropriate bit-shift operationcannot be used to cancel out the operation in a simple manner.

A solution to this is proposed as follows:

At the quantiser stage, apply a right shift:quantTransformRightShift=15−log 2(S′)−bitDepth

Where the value S′ is derived such thatresultingShift−quantTransformRightShift=+½

-   -   quantTransformRightShift is an integer

The difference between shifts of ½ is equivalent to multiplication bysqrt(2), i.e. at this point the coefficients are sqrt(2) times largerthan they should be, making the bit shift an integer bit shift.

For the quantisation process, apply a quantisation parameter of (QP+3),meaning that the quantising divisor is effectively increased by a factorof sqrt(2), thus cancelling out the sqrt(2) scale factor from theprevious step.

Accordingly, these steps can be summarised (in the context of a videocoding or decoding method (or corresponding apparatus or program)operable to generate blocks of quantised spatial frequency data byperforming frequency-transformation on blocks of video data samplesusing a transform matrix comprising an array of integer values which areeach scaled with respect to respective values of a normalized transformmatrix, and to quantise the spatial frequency data according to aselected quantisation step size, involving frequency-transforming ablock of video data samples by matrix-multiplying the block by thetransform matrix and the transposition of the transform matrix togenerate a block of scaled spatial frequency coefficients which are eachlarger, by a common scaling factor, than the spatial frequencycoefficients which would result from a normalizedfrequency-transformation of that block of video data samples) asfollows: selecting a quantisation step size for quantising the spatialfrequency coefficients; applying an n-bit shift (for example,quantTransformRightShift) to divide each of the scaled spatial frequencycoefficients by a factor of 2^(n), where n is an integer; and detectinga residual scaling factor (for example,resultingShift-quantTransformRightShift), being the common scalingfactor divided by 2^(n). For example, in the situation discussed above,the quantisation step size is then according to the residual scalingfactor to generate a modified quantisation step size; and each of thescaled spatial frequency coefficients in the block is divided by a valuedependent upon the modified quantisation step size and rounding theresult to an integer value, to generate the block of quantised spatialfrequency data. As discussed, the modification of the quantisation stepsize can be carried out simply by adding an offset to QP so as to selecta different quantisation step size when QP is mapped into the table ofquantisation step sizes.

The coefficients are now of the correct magnitude for the original QP.

The transform matrix can comprise an array of integer values which areeach scaled with respect to respective values of a normalized transformmatrix by an amount dependent upon a dimension of the transform matrix.

It follows that the required value for S′ can always be derived asfollows:S′=sqrt(2*M*N)

As an alternative proposal, S′ could be derived such that:resultingShift−quantTransformRightShift=−½

In this case, S′=sqrt(½*M*N), and the applied quantisation parameter is(QP−3)

In either of these cases, (adding 3 to QP or subtracting 3 from QP), thestep of selecting the quantisation step size comprises selecting aquantisation index (for example, QP), the quantisation index defining arespective entry in a table of quantisation step sizes, and themodifying step comprises changing the quantisation index so as to selecta different quantisation step size, such that the ratio of the differentquantisation step size to the originally selected quantisation step sizeis substantially equal to the residual scaling factor.

This works particularly well where, as in the present embodiments,successive values of the quantisation step sizes in the table arerelated logarithmically, so that a change in quantisation index (forexample, QP) of m (where m is an integer) represents a change inquantisation step size by a factor of p (where p is an integer greaterthan 1). In the present embodiments, m=6 and p=2, so that an increase of6 in QP represents a doubling of the applied quantisation step size, anda decrease in QP of 6 represents a halving of the resulting quantisationstep size.

As discussed above, the modification can be carried out by selecting aquantisation index (for example, a base QP) in respect of luminancesamples; generating a quantisation index offset, relative to thequantisation index selected for the luminance samples, for samples ofeach or both chrominance components; changing the quantisation indexoffset according to the residual scaling factor; and communicating thequantisation index offset in association with the coded video data. Inembodiments of HEVC, QP offsets for the two chroma channels are sent inthe bit stream. These steps correspond to a system in which the QPoffset (to account for the residual scaling factor) of +/−3 could beincorporated into these offsets, or they could beincremented/decremented when they are used to derive the chroma QP.

Note that the QP offset does not have to be +/−3 if differently shapedblocks were used; it is just that +/−3 represents an offset applicableto the block shapes and aspect ratios discussed above in respect of4:2:2 video, for example.

In some embodiments, n (the bit shift as applied) is selected so that2^(n) is greater than or equal to the common scaling factor. In otherembodiments, n is selected so that 2^(n) is less than or equal to thecommon scaling factor. In embodiments of the disclosure (using either ofthese arrangements), a bit shift n can be selected so as to be the nextnearest (in either direction) to the common scaling factor, so that theresidual scaling factor represents a factor having a magnitude of lessthan 2.

In other embodiments, the modification of the quantisation step size cansimply be performed by multiplying the quantisation step size by afactor dependent upon the residual scaling factor. That is to say, themodification need not involve modifying the index QP.

Note also that the quantisation step size as discussed is notnecessarily the actual quantisation step size by which a transformedsample is divided. The quantisation step size derived in this way can befurther modified. For example, in some arrangements, the quantisationstep size is further modified by respective entries in a matrix ofvalues (Qmatrix) so that different final quantisation step sizes areused at different coefficient positions in a quantised block ofcoefficients.

It is also notable that in the 4:2:0 scheme, the largest chroma TU is16×16, whereas for the 4:2:2 scheme 16×32 TUs are possible, and for the4:4:4 scheme, 32×32 chroma TUs are possible. Consequently in anembodiment of the present disclosure quantisation matrices (Qmatrices)for 32×32 chroma TUs are proposed. Similarly, Qmatrices should bedefined for non-square TUs such as the 16×32 TU, with one embodimentbeing the subsampling of a larger square Q matrix

Qmatrices could be defined by any one of the following:

values in a grid (as for 4×4 and 8×8 Qmatrices);

interpolated spatially from smaller or larger matrices;

-   -   in HEVC larger Qmatrices can be derived from respective groups        of coefficients of smaller reference ones, or smaller matrices        can be sub-sampled from larger matrices. Note that this        interpolation or subsampling can be carried out within a channel        ratio—for example, a larger matrix for a channel ratio can be        interpolated from a smaller one for that channel ratio.

relative to other Qmatrices (i.e. difference values, or deltas);

-   -   hence only the deltas need to be sent.

Taking a small example just for illustrative purposes, a particularmatrix for one channel ratio could be defined, such as a 4×4 matrix inrespect of 4:2:0

-   -   (a b)    -   (c d)

where a, b, c and d are respective coefficients. This acts as areference matrix.

Embodiments of the disclosure could then define a set of differencevalues for a similar-sized matrix in respect of another channel ratio:

-   -   (diff1 diff2)    -   (diff3 diff4)

so that in order to generate the Qmatrix for the other channel ratio,the matrix of differences is matrix-added to the reference matrix.

Instead of differences, a matrix of multiplicative factors could bedefined for the other channel ratio, such that either (i) the matrix ofmultiplicative factors is matrix-multiplied with the reference matrix togenerate the Qmatrix for the other channel ratio, or (ii) eachcoefficient in the reference matrix is individually multiplied by arespective factor to generate the Qmatrix for the other channel ratio.

as a function of another Qmatrix;

-   -   e.g. a scaling ratio relative to another matrix (so that each of        a, b, c and d in the above example is multiplied by the same        factor, or has the same difference added to it). This reduces        the data requirements for transmitting the difference or factor        data.    -   hence only the coefficients of the functions need to be sent        (such as the scaling ratio),

as an equation/function (e.g. piece-wise linear curve, exponential,polynomial);

-   -   hence only the coefficients of the equations need to be sent to        derive the matrix,

or any combination of the above. For example, each of a, b, c and dcould in fact be defined by a function which could include a dependenceupon the coefficient position (i,j) within the matrix. (I, j) couldrepresent, for example, the coefficient position from left to rightfollowed by the coefficient position from top to bottom of the matrix.An example is:coefficient_(i,j)=3i+2j

Note that Qmatrices can be referred to as Scaling Lists within the HEVCenvironment. In embodiments in which the quantisation is applied afterthe scanning process, the scanned data may be a linear stream ofsuccessive data samples. In such instances, the concept of a Qmatrixstill applies, but the matrix (or Scanning List) may be considered as a1×N matrix, such that the order of the N data values within the 1×Nmatrix corresponds to the order of scanned samples to which therespective Qmatrix value is to be applied. In other words, there is a1:1 relationship between data order in the scanned data, spatialfrequency according to the scan pattern, and data order in the 1×NQmatrix.

Note that it is possible, in some implementations, to bypass or omit theDCT (frequency separation) stage, but to retain the quantisation stage.

Other useful information includes an optional indicator of to whichother matrix the values are related, i.e. the previous channel or thefirst (primary) channel; for example the matrix for Cr could be a scaledfactor of a matrix for Y, or for Cb, as indicated.

Accordingly, embodiments of the disclosure can provide a video coding ordecoding method (and a corresponding apparatus or computer program)operable to generate blocks of quantised spatial frequency data by(optionally) performing frequency-transformation on blocks of video datasamples and quantising the video data (such as the spatial frequencydata) according to a selected quantisation step size and a matrix ofdata modifying the quantisation step size for use at differentrespective block positions within an ordered block of samples (such asan ordered block of frequency-transformed samples), the method beingoperable with respect to at least two different chrominance subsamplingformats.

For at least one of the chrominance subsampling formats, one or morequantisation matrices are defined as one or more predeterminedmodifications with respect to one or more reference quantisationmatrices defined for a reference one of the chrominance subsamplingformats.

In embodiments of the disclosure, the defining step comprises definingone or more quantisation matrices as a matrix of values eachinterpolated from a respective plurality of values of a referencequantisation matrix. In other embodiments, the defining step comprisesdefining one or more quantisation matrices as a matrix of values eachsubsampled from values of a reference quantisation matrix.

In embodiments of the disclosure, the defining step comprises definingone or more quantisation matrices as a matrix of differences withrespect to corresponding values of a reference quantisation matrix.

In embodiments of the disclosure, the defining step comprises definingone or more quantisation matrices as a predetermined function of valuesof a reference quantisation matrix. In such instances, the predeterminedfunction may be a polynomial function.

In embodiments of the disclosure, one or both of the following isprovided, for example as part of or in association with the coded videodata: (i) reference-indicator data to indicate, with respect to encodedvideo data, the reference quantisation matrix; and (ii)modification-indicator data to indicate, with respect to encoded datavalues, the one or more predetermined modifications.

These techniques are particularly applicable where two of thechrominance subsampling formats are 4:4:4 and 4:2:2 formats.

The number of Q Matrices in HEVC 4:2:0 is currently 6 for each transformsize: 3 for the corresponding channels, and one set for intra and forinter. In the case of a 4:4:4 GBR scheme, it will be appreciated thateither one set of quantisation matrices could be used for all channels,or three respective sets of quantisation matrices could be used.

In embodiments of the disclosure, at least one of the matrices is a 1×Nmatrix. This would be the case in (as described here) one or more of thematrices is in fact a Scaling List or the like, being a linear 1×Nordered array of coefficients.

The proposed solutions involve incrementing or decrementing the appliedQP. However this could be achieved in a number of ways:

In HEVC, QP offsets for the two chroma channels are sent in the bitstream. The +/−3 could be incorporated into these offsets, or they couldbe incremented/decremented when they are used to derive the chroma QP.

As discussed, above, in HEVC, (luma QP+chroma offset) is used as anindex to a table in order to derive the chroma QP. This table could bemodified to incorporate the +/−3 (i.e. by incrementing/decrementing thevalues of the original table by 3)

After the chroma QP has been derived, as per the normal HEVC process,the results could then be incremented (or decremented) by 3.

As an alternative to modifying the QP, a factor of sqrt(2) or 1/sqrt(2)can be used to modify the quantisation coefficients.

For forward/inverse quantisation, the division/multiplication processesare implemented by using (QP % 6) as an index to a table to obtain aquantisation coefficient or quantisation step size,inverseQStep/scaledQStep. (Here, QP % 6 signifies QP modulo 6). Notethat, as discussed above, this may not represent the final quantisationstep size which is applied to the transformed data; it may be furthermodified by the Qmatrices before use.

The default tables in HEVC are of length 6, covering an octave (adoubling) of values. This is simply a means of reducing storagerequirements; the tables are extended for actual use by selecting anentry in the table according to the modulus of QP (mod 6) and thenmultiplying or dividing by an appropriate power of 2, dependent upon thedifference of (QP−QP modulus 6) from a predetermined base value.

This arrangement could be varied to allow for the offset of +/−3 in theQP value. The offset can be applied in the table look-up process, or themodulus process discussed above could instead be carried out using themodified QP. Assuming the offset is applied at the table look-up,however, additional entries in the table can be provided as follows: Onealternative is to extend the tables by 3 entries, where the new entriesare as follows (for the index values of 6-8).

The example table shown in FIG. 30 would be indexed by [(QP % 6)+3] (a“QP increment method”), where the notation QP % 6 signifies “QP modulus6”.

The example table shown in FIG. 31 would be indexed by [(QP % 6)−3] (a“QP decrement method”), having extra entries for the index values of −1to −3:

Entropy Encoding

Basic entropy encoding comprises assigning codewords to input datasymbols, where the shortest available codewords are assigned to the mostprobable symbols in the input data. On average the result is a losslessbut much smaller representation of the input data.

This basic scheme can be improved upon further by recognising thatsymbol probability is often conditional on recent prior data, andconsequently making the assignment process context adaptive.

In such a scheme, context variables (CVs) are used to determine thechoice of respective probability models, and such CVs are provided forin the HEVC 4:2:0 scheme.

To extend entropy encoding to the 4:2:2 scheme, which for example willuse 4×8 chroma TUs rather than 4×4 TUs for an 8×8 luma TU, optionallythe context variables can be provided for by simply vertically repeatingthe equivalent CV selections.

However, in an embodiment of the present disclosure the CV selectionsare not repeated for the top-left coefficients (i.e. the high-energy, DCand/or low spatial frequency coefficients), and instead new CVs arederived. In this case, for example, a mapping may be derived from theluma map. This approach may also be used for the 4:4:4 scheme.

During coding, in the 4:2:0 scheme, a so-called zig-scan scans throughthe coefficients in order from high to low frequencies. However, againit is noted that the chroma TUs in the 4:2:2 scheme can be non-square,and so in an embodiment of the present disclosure a different chromascan is proposed with the angle of the scan be tilted to make it morehorizontal, or more generally, responsive to the aspect ratio of the TU.

Similarly, the neighborhood for significance map CV selection and thec1/c2 system for greater-than-one and greater-than-two CV selection maybe adapted accordingly.

Likewise, in an embodiment of the present disclosure the lastsignificant coefficient position (which becomes the start point duringdecoding) could also be adjusted for the 4:4:4 scheme, withlast-significant positions for chroma TUs being coded differentiallyfrom the last-significant position in the co-located luma TU.

The coefficient scanning can also be made prediction mode dependent forcertain TU sizes. Hence a different scan order can be used for some TUsizes dependent on the intra-prediction mode.

In the 4:2:0 scheme, mode dependent coefficient scanning (MDCS) is onlyapplied for 4×4/8×8 luma TUs and 4×4 chroma TUs for intra prediction.MDCS is used dependent on the intra-prediction mode, with angles +/−4from the horizontal and vertical being considered.

In an embodiment of the present disclosure, it is proposed that in the4:2:2 scheme MDCS is applied to 4×8 and 8×4 chroma TUs for intraprediction. Similarly, it is proposed that in the 4:4:4 scheme MDCS isapplied to 8×8 and 4×4 chroma TUs. MDCS for 4:2:2 may only be done inthe horizontal or vertical directions, and that the angle ranges maydiffer for 4:4:4 chroma vs. 4:4:4 luma vs. 4:2:2 chroma vs. 4:2:2 lumavs. 4:2:0 luma.

In-Loop Filters

Deblocking

Deblocking is applied to all CU, PU and TU boundaries, and the CU/PU/TUshape is not taken into account. The filter strength and size isdependent on local statistics, and deblocking has a granularity of 8×8Luma pixels.

Consequently it is anticipated that the current deblocking applied forthe 4:2:0 scheme should also be applicable for the 4:2:2 and 4:4:4schemes.

Sample Adaptive Offsetting

In sample adaptive offsetting (SAO) each channel is completelyindependent. SAO splits the image data for each channel using aquad-tree, and the resulting blocks are at least one LCU in size. Theleaf blocks are aligned to LCU boundaries and each leaf can run in oneof three modes, as determined by the encoder (“Central band offset”,“Side band offset” or “Edge offset”). Each leaf categorises its pixels,and the encoder derives an offset value for each of the 16 categories bycomparing the SAO input data to the source data. These offsets are sentto the decoder. The offset for a decoded pixel's category is added toits value to minimise the deviation from the source.

In addition, SAO is enabled or disabled at picture level; if enabled forluma, it can also be enabled separately for each chroma channel. SAOwill therefore be applied to chroma only if it is applied to luma.

Consequently the process is largely transparent to the underlying blockscheme and it is anticipated that the current SAO applied for the 4:2:0scheme should also be applicable for the 4:2:2 and 4:4:4 schemes.

Adaptive Loop Filtering

In the 4:2:0 scheme, adaptive loop filtering (ALF) is disabled bydefault. However, in principle (i.e. if allowed) then ALF would beapplied to the entire picture for chroma.

In ALF, luma samples may be sorted into one of a number of categories,as determined by the HEVC documents; each category uses a differentWiener-based filter.

By contrast, in 4:2:0 chroma samples are not categorised—there is justone Wiener-based filter for Cb, and one for Cr.

Hence in an embodiment of the present disclosure, in light of theincreased chroma information in the 4:2:2 and 4:4:4 schemes, it isproposed that the chroma samples are categorised; for example with Kcategories for 4:2:2 and J categories for 4:4:4.

Whilst in the 4:2:0 scheme ALF can be disabled for luma on a per-CUbasis using an ALF control flag (down to the CU-level specified by theALF control depth), it can only be disabled for chroma on a per-picturebasis. Note that in HEVC, this depth is currently limited to the LCUlevel only.

Consequently in an embodiment of the present disclosure, the 4:2:2 and4:4:4 schemes are provided with one or two channel specific ALF controlflags for chroma.

Syntax

In HEVC, syntax is already present to indicate 4:2:0, 4:2:2 or 4:4:4schemes, and is indicated at the sequence level. However, in anembodiment of the present disclosure it is proposed to also indicate4:4:4 GBR coding at this level.

MDDT and MDCS

The use of mode dependent directional transforms and mode dependentcoefficient scanning will now be described. Note that both may beimplemented in the same system, or one may be used and the other not, orneither may be used.

MDCS will be described first, with reference to FIGS. 34 to 38.

A so-called up-right diagonal scan pattern was described above withreference to FIG. 16. The scan pattern is used to derive an order bywhich frequency-separated coefficients, such as DCT coefficients, areprocessed. The up-right diagonal pattern is one example of a scanpattern, but other patterns are available. Two further examples areshown schematically in FIGS. 34 and 35, this time using the example of a4×4 block. These are: a horizontal scan pattern (FIG. 34), and avertical scan pattern (FIG. 35).

In MDCS, a scan pattern is selected from a group of two or morecandidate scan patterns in dependence upon the prediction mode in use.

The present example concerns a group of three candidate scan patterns,the up-right diagonal pattern, the horizontal pattern and the verticalpattern. But a different group of two or more candidate patterns couldbe used.

Referring to FIG. 36, the vertical scan pattern is used for modes 6 to14, which are modes that are within a threshold angle (or mode number)of horizontal (predominantly horizontal). The horizontal scan pattern isused for modes 22 to 30, which are modes that are within a thresholdangle (or mode number) of vertical (predominantly vertical). Theup-right diagonal scan, referred to in FIG. 36 as just the “diagonal”scan, is used for other modes.

FIG. 37 schematically illustrates a possible mapping of two candidatescan patterns (vertical and horizontal) to the directional predictionmodes applicable to a rectangular array of chroma samples. The patternis different to that used (FIG. 36) for luma samples.

FIG. 38 schematically illustrates an arrangement for selecting a scanpattern. This can form part of the functionality of the controller 343,for example.

A selector 1620 is responsive to a prediction mode for the current blockand a look-up table 1630 which maps prediction mode to scan pattern. Theselector 1620 outputs data indicative of the selected scan pattern.

MDCS may be enabled for 4:2:2 and 4:4:4. The mapping of scan patterns toprediction modes may be the same as for 4:2:0, or may be different. Eachchannel ratio may have a respective mapping (in which case the selector1620 may be responsive to the channel ratio as well) or the mappingcould be consistent across channel ratios. MDCS may be applied only tocertain block sizes, for example block sizes no greater than a thresholdblock size. For example, the maximum TU sizes to which MDCS is appliedmay be:

Format Luma Chroma 4:2:0 8 × 8 4 × 4 4:2:2 8 × 8 4 × 8 4:4:4 8 × 8 8 × 8

For chroma, MDCS may be disabled, limited to 4×4 (luma) TUs only orlimited to TUs using only horizontal or vertical scan. Theimplementation of the MDCS feature may vary with channel ratio.

Embodiments of the disclosure therefore provide a method of coding 4:2:2or 4:4:4: video data in which differences between predicted and originalsamples are frequency-separated and encoded, comprising: predictingluminance and/or chrominance samples of an image from other respectivereference samples derived from the same image according to a predictionmode associated with a sample to be predicted, the prediction mode beingselected for each of a plurality of blocks of samples, from a set of twoor more candidate prediction modes; detecting differences between thesamples and the respective predicted samples;

frequency-separating the detected differences for a block of samples,using a frequency-separation transform, to generate a corresponding setof frequency-separated coefficients; selecting a scan pattern from a setof two or more candidate scan patterns, each scan pattern defining anorder of encoding the set of frequency-separated coefficients, independence upon the prediction mode for that block of samples using amapping provided (for example by the controller 343) between scanpattern and prediction mode, the mapping between different, as betweenchrominance and luminance samples, for at least the 4:4:4: format (so,in other words, the mapping is different for 4:4:4 chroma and 4:4:4 lumadata, and may or may not be different as between 4:2:2 luma and 4:2:2chroma data); and encoding the frequency-separated difference data in anorder of frequency-separated coefficients according to the selected scanpattern.

The mapping may be different for 4:2:2 luminance and chrominance data.

The mapping may be different for 4:2:2 and 4:4:4 video data.

In embodiments of the disclosure, the size of a current block ofluminance samples is 4×4 or 8×8 samples. Alternatively, embodiments ofthe disclosure comprise selecting the size of the current block ofsamples from a set of candidate sizes; and applying the step ofselecting a scan pattern if the selected block size is one of apredetermined subset of the set of candidate sizes. In this way, themapping process can be applied in respect of some block sizes but notothers. The mapping may be applied (for 4:2:2) only in respect ofluminance samples.

In embodiments of the disclosure, the set of candidate scan patterns isdifferent for use in respect of luminance and chrominance samples.

The selecting step may be configured to select a horizontal scan patternin respect of a set of predominantly horizontal prediction modes, toselect a vertical scan pattern in respect of a set of predominantlyvertical prediction modes, and to select a diagonal scan pattern inrespect of other prediction modes.

Embodiments of the disclosure also provide a method of decoding 4:2:2 or4:4:4 video data in which differences between predicted and originalsamples are frequency-separated and encoded, comprising: predictingluminance and/or chrominance samples of an image from other respectivereference samples derived from the same image according to a predictionmode associated with a sample to be predicted, the prediction mode beingselected for each of a plurality of blocks of samples, from a set of twoor more candidate prediction modes; selecting a scan pattern from a setof two or more candidate scan patterns, each scan pattern defining anorder of encoding the set of frequency-separated coefficients, independence upon the prediction mode for that block of samples using amapping between scan pattern and prediction mode, the mapping betweendifferent, as between chrominance and luminance samples, for at leastthe 4:4:4: format (so, in other words, the mapping is different for4:4:4 chroma and 4:4:4 luma data, and may or may not be different asbetween 4:2:2 luma and 4:2:2 chroma data); and decodingfrequency-separated difference data representing a frequency-separatedversion of data indicative of differences between the samples to bedecoded and respective predicted samples, in an order offrequency-separated coefficients according to the selected scan pattern.

With regard to MDDT, FIG. 39 schematically illustrates an arrangementfor selecting a frequency-separating transform according to predictionmode. The arrangement may form part of the functionality of thetransform unit or of the controller.

A selector 1700 receives data defining the current prediction mode andselects a transform (from a set of two or more candidate transforms) independence upon that mode. The transform is applied by a transformengine 1710 to convert image samples into frequency-transformedcoefficients, on the basis of data indicative of the required transform,stored in a transform data store.

Examples of candidate transforms include the discrete cosine transform(DCT), the discreet sine transform (DST), the Karhunen-Loeve transform;and transforms defined by respective row and column matrices formatrix-multiplication by the current block of samples.

MDDT may be enabled, for example, in respect of 4×4 chroma blocks in a4:4:4 system. However, in embodiments of the disclosure, MDDT is enabledin respect of 4:2:2 data.

Accordingly, embodiments of the disclosure can provide a method ofcoding 4:2:2 or 4:4:4 video data, comprising: predicting luminanceand/or chrominance samples of an image from other respective referencesamples derived from the same image according to a prediction modeassociated with a sample to be predicted, the prediction mode beingselected for each of a plurality of blocks of samples, from a set of twoor more candidate prediction modes; detecting differences between thesamples and the respective predicted samples; selecting afrequency-separation transform from two or more candidate frequencyseparation transforms according to the prediction mode associated with acurrent block of samples using a mapping (provided, for example, by thecontroller 343) between transform and prediction mode, the mapping beingdifferent, as between chrominance and luminance samples, for at leastthe 4:4:4: format (so, in other words, the mapping is different for4:4:4 chroma and 4:4:4 luma data, and may or may not be different asbetween 4:2:2 luma and 4:2:2 chroma data); and encoding the detecteddifferences by frequency-separating the differences, using the selectedfrequency-separation transform.

The candidate transforms may comprise two or more transforms selectedfrom the list consisting of: the discrete cosine transform; the discretesine transform; the Karhunen-Loeve transform; and transforms defined byrespective row and column matrices for matrix-multiplication by thecurrent block of samples (so that, for example, a transform is definedby TXT^(T), where T is the transform matrix, the superscript T signifiesthe transpose of the matrix, and X signifies a block of samples inmatrix form).

As before, in embodiments of the disclosure the prediction modeassociated with a block of samples to be predicted indicates aprediction direction defining one or more other respective referencesamples from which each sample of that block is to be predicted, or mayindicate a dc prediction mode for example.

In embodiments of the disclosure a mapping provided between predictionmode and frequency-separation transform may be different betweenluminance and chrominance data for the 4:2:2 format.

In embodiments of the disclosure, the size of a current block ofluminance samples is 4×4 samples. Alternatively, the method may compriseselecting the size of the current block of samples from a set ofcandidate sizes; and applying the step of selecting afrequency-separation transform if the selected block size is one of apredetermined subset of the set of candidate sizes, so that MDDT is usedonly for some but not all block (for example, TU) sizes.

In embodiments of the disclosure, the step of encoding the detecteddifferences comprises selecting a scan pattern from a set of two or morecandidate scan patterns, each scan pattern defining an order of encodingthe set of frequency-separated coefficients, in dependence upon theprediction mode for that block of samples; and encoding thefrequency-separated difference data in an order of frequency-separatedcoefficients according to the selected scan pattern. In other words,this represents a system which uses both MDCS and MDDT.

Coded Block Flag

The coded block flag (CBF) is used to indicate—for a luma TU—whetherthat TU contains any non-zero coefficients. It provides a simple yes/noanswer which allows the encoding process to skip blocks which have nodata to be encoded.

In some arrangements, CBFs are used for chroma data, but are provided ateach splitting level. This is because chroma components often have alower amount of information and so a chroma block could be found tocontain zero data at a higher splitting level than that at which acorresponding luma block is found to contain no data.

In some embodiments, however, chroma is treated exactly the same as lumafor the purposes of allocating CBF flags.

CABAC Encoding and Context Modelling

FIG. 40 schematically illustrates the operation of a CABAC entropyencoder.

The CABAC encoder operates in respect of binary data, that is to say,data represented by only the two symbols 0 and 1. The encoder makes useof a so-called context modelling process which selects a “context” orprobability model for subsequent data on the basis of previously encodeddata. The selection of the context is carried out in a deterministic wayso that the same determination, on the basis of previously decoded data,can be performed at the decoder without the need for further data(specifying the context) to be added to the encoded datastream passed tothe decoder.

Referring to FIG. 40, input data to be encoded may be passed to a binaryconverter 1900 if it is not already in a binary form; if the data isalready in binary form, the converter 1900 is bypassed (by a schematicswitch 1910). In the present embodiments, conversion to a binary form isactually carried out by expressing the quantised DCT (or otherfrequency-separated) coefficient data as a series of binary “maps”,which will be described further below.

The binary data may then be handled by one of two processing paths, a“regular” and a “bypass” path (which are shown schematically as separatepaths but which, in embodiments of the disclosure discussed below, couldin fact be implemented by the same processing stages, just usingslightly different parameters). The bypass path employs a so-calledbypass coder 1920 which does not necessarily make use of contextmodelling in the same form as the regular path. In some examples ofCABAC coding, this bypass path can be selected if there is a need forparticularly rapid processing of a batch of data, but in the presentembodiments two features of so-called “bypass” data are noted: firstly,the bypass data is handled by the CABAC encoder (1950, 1960), just usinga fixed context model representing a 50% probability; and secondly, thebypass data relates to certain categories of data, one particularexample being coefficient sign data. Otherwise, the regular path isselected by schematic switches 1930, 1940. This involves the data beingprocessed by a context modeller 1950 followed by a coding engine 1960.

The entropy encoder shown in FIG. 40 encodes a block of data (that is,for example, data corresponding to a block of coefficients relating to ablock of the residual image) as a single value if the block is formedentirely of zero-valued data. For each block that does not fall intothis category, that is to say a block that contains at least somenon-zero data, a “significance map” is prepared. The significance mapindicates whether, for each position in a block of data to be encoded,the corresponding coefficient in the block is non-zero. The significancemap data, being in binary form, is itself CABAC encoded. The use of thesignificance map assists with compression because no data needs to beencoded for a coefficient with a magnitude that the significance mapindicates to be zero. Also, the significance map can include a specialcode to indicate the final non-zero coefficient in the block, so thatall of the final high frequency/trailing zero coefficients can beomitted from the encoding. The significance map is followed, in theencoded bitstream, by data defining the values of the non-zerocoefficients specified by the significance map.

Further levels of map data are also prepared and are CABAC encoded. Anexample is a map which defines, as a binary value (1=yes, 0=no) whetherthe coefficient data at a map position which the significance map hasindicated to be “non-zero” actually has the value of “one”. Another mapspecifies whether the coefficient data at a map position which thesignificance map has indicated to be “non-zero” actually has the valueof “two”. A further map indicates, for those map positions where thesignificance map has indicated that the coefficient data is “non-zero”,whether the data has a value of “greater than two”. Another mapindicates, again for data identified as “non-zero”, the sign of the datavalue (using a predetermined binary notation such as 1 for +, 0 for −,or of course the other way around).

In embodiments of the disclosure, the significance map and other mapsare generated from the quantised DCT coefficients, for example by thescan unit 360, and is subjected to a zigzag scanning process (or ascanning process selected from those discussed above) before beingsubjected to CABAC encoding.

In general terms, CABAC encoding involves predicting a context, or aprobability model, for a next bit to be encoded, based upon otherpreviously encoded data. If the next bit is the same as the bitidentified as “most likely” by the probability model, then the encodingof the information that “the next bit agrees with the probability model”can be encoded with great efficiency. It is less efficient to encodethat “the next bit does not agree with the probability model”, so thederivation of the context data is important to good operation of theencoder. The term “adaptive” means that the context or probabilitymodels are adapted, or varied during encoding, in an attempt to providea good match to the (as yet uncoded) next data.

Using a simple analogy, in the written English language, the letter “U”is relatively uncommon. But in a letter position immediately after theletter “Q”, it is very common indeed. So, a probability model might setthe probability of a “U” as a very low value, but if the current letteris a “Q”, the probability model for a “U” as the next letter could beset to a very high probability value.

CABAC encoding is used, in the present arrangements, for at least thesignificance map and the maps indicating whether the non-zero values areone or two. Bypass processing—which in these embodiments is identical toCABAC encoding but for the fact that the probability model is fixed atan equal (0.5:0.5) probability distribution of 1s and 0s, is used for atleast the sign data and the map indicating whether a value is >2. Forthose data positions identified as >2, a separate so-called escape dataencoding can be used to encode the actual value of the data. This mayinclude a Golomb-Rice encoding technique.

The CABAC context modelling and encoding process is described in moredetail in WD4: Working Draft 4 of High-Efficiency Video Coding,JCTVC-F803_d5, Draft ISO/IEC 23008-HEVC; 201x(E) 2011 Oct. 2028.

The context variables are reset at the end of processing a slice.

Reference will now be made to a method of video data coding, comprising:predicting blocks of luminance and/or chrominance samples of an imagefrom other respective reference samples or values; detecting differencesbetween the samples in a block and the respective predicted samples;frequency-separating the detected differences in respect of each blockso as to generate a corresponding array of frequency-separatedcoefficients ordered according to increasing spatial frequenciesrepresented by the coefficients; and entropy-encoding thefrequency-separated coefficients using a context adaptive arithmeticcode which encodes coefficients with respect to context variablesindicative of the probability of a coefficient having a particularcoefficient value; in which the entropy-encoding step comprises:partitioning each array into two or more coefficient groups, the groupsbeing non-square sub-arrays; and selecting a context variable to encodea coefficient according to the spatial frequencies represented by thatcoefficient and in dependence upon the values of coefficients in one ormore nearby groups of coefficients in that array or an arraycorresponding to a neighbouring block of samples.

This is sometimes known as neighbourhood context variable allocation,which allows for the allocation pattern of context variable tocoefficient position to be set on a sub-array by sub-array basis (asub-array being a portion of a block of coefficients) according towhether there are any non-zero coefficients in neighbouring sub-arrays.The scan pattern selected for use with the frequency-separated data maybe relevant, such that the entropy-encoding step comprises encoding thecoefficients of an array in an order dependent upon a scan patternselected from a set of one or more candidate scan patterns. Eachsub-array of coefficients can be considered as a successive set of ncoefficients in the order defined by the scan pattern applicable to thatarray, where n is an integer factor of the number of coefficients in thearray. For example, n may be 16.

FIGS. 41A to 41D schematically illustrate the situation for previouslyproposed neighbourhood allocation.

In embodiments of the disclosure, the selecting step allocatescoefficients in a group to one of a set of candidate context variablesso that, within each group, successive subsets of coefficients, in thescan order, are allocated to respective ones of the candidate contextvariables. In the examples shown in FIGS. 42A to 43B, a vertical scanorder is used and allocations are made in that order. In FIG. 44, ahorizontal scan order is used and allocations are made in that order.

As mentioned, the selecting step depends upon whether the nearbycoefficients have a zero value. There may be two candidate contextvariables for each group of coefficients.

Turning now to FIGS. 42A, 42B, 43A, 43B and 44, the format of thedrawings shown is that the coefficients are ordered within an array sothat horizontal spatial frequency increases from left to right in thearray and vertical spatial frequency increases from top to bottom in anarray.

There are two options for how to deal with missing data (for example,data at the edges of a picture or slice, or data that has not yet beenencoded. In one option (FIG. 42A), if a group of coefficients nearby acurrent group has not yet been frequency-separated, the selecting stepassigns zero values to that group for the purposes of selecting acontext variable for a coefficient in the current group. In anotheroption (FIG. 42B), if a first group of coefficients nearby a currentgroup has not yet been frequency-separated, but a second groupneighbouring a current group has been frequency-separated, then theselecting assigns the values of the second group to the first group forthe purposes of selecting a context variable for a coefficient in thecurrent group.

Referring to FIGS. 42A to 42B, if both the groups to the right and belowthe current group contain non-zero coefficient data, then one contextvariable is allocated by the selecting step to the first m coefficientsof the current group in the scan order and another context variable tothe remaining coefficients of the current group. If the group to theright of the current group has non-zero data but the group below thecurrent group does not, then one context variable is allocated by theselecting step to an upper half of the current group and another contextvariable to the remaining coefficients of the current group. If thegroup below the current group has non-zero data but the group to theright of the current group does not, then one context variable isallocated by the selecting step to the first p coefficients of thecurrent group in the scan order and another context variable to theremaining coefficients of the current group. If the group below thecurrent group has non-zero data but the group to the right of thecurrent group does not, then one context variable is allocated by theselecting step to an left half of the current group and another contextvariable to the remaining coefficients of the current group. In theexamples shown, m and p are integers, and m does not equal p. Inparticular, in the examples shown, a current group comprises a sub-arrayof 8×2 or 2×8 coefficients; and m=13 and p=6.

The method shown is applicable to blocks of samples which have a size ofat least 8 samples in at least one dimension. An example is an 8×8 blockor bigger.

The technique is useable whether at least some of the blocks of samples(TUs) are square, or at least some of the blocks of samples (TUs) arenon-square.

Referring now to FIG. 45, embodiments of the disclosure also provide amethod of video data coding, comprising: predicting blocks of luminanceand/or chrominance samples of an image from other respective referencesamples or values; detecting differences between the samples in a blockand the respective predicted samples; frequency-separating the detecteddifferences in respect of each block so as to generate a correspondingarray of frequency-separated coefficients ordered according to thespatial frequencies represented by the coefficients, one of thecoefficients representing a dc value of the block; and entropy-encodingthe frequency-separated coefficients using a context adaptive arithmeticcode which encodes coefficients with respect to context variablesindicative of the probability of a coefficient having a particularcoefficient value; in which the entropy-encoding step comprises:partitioning each array into two or more coefficient groups, the groupsbeing non-square sub-arrays; and generating an allocation of contextvariables to encode respective coefficients generated in respect of anon-square sub-array according to the spatial frequencies represented bythat coefficient, by position-repeating the context variable allocationsapplicable to a square sub-array, but not position-repeating theallocation of a context variable to the dc coefficient. As shown in FIG.45, the allocation pattern for the 8×16 sub-array is a value-repeatedpattern derived from the 8×8 sub-array allocation pattern, but the dcallocation (the top left corner as drawn) is not value-repeated. Inother words, the context variable allocated to the dc coefficient is notallocated to any other coefficient.

Data Signals

It will be appreciated that data signals generated by the variants ofcoding apparatus discussed above, and storage or transmission mediacarrying such signals, are considered to represent embodiments of thepresent disclosure.

Where methods of processing, coding or decoding are discussed above, itwill be appreciated that apparatus configured to perform such methodsare also considered to represent embodiments of the disclosure. It willalso be appreciated that video storage, transmission, capture and/ordisplay apparatus incorporating such techniques is considered torepresent an embodiment of the present disclosure.

In so far as embodiments of the disclosure have been described as beingimplemented, at least in part, by software-controlled data processingapparatus, it will be appreciated that a non-transitory machine-readablemedium carrying such software, such as an optical disk, a magnetic disk,semiconductor memory or the like, is also considered to represent anembodiment of the present disclosure.

It will be apparent that numerous modifications and variations of thepresent disclosure are possible in light of the above teachings. It istherefore to be understood that within the scope of the appended claims,the technology may be practiced otherwise than as specifically describedherein.

Respective features of embodiments are defined by the following numberedclauses:

1. A method of video data coding, comprising:

-   -   predicting blocks of luminance and/or chrominance samples of an        image from other respective reference samples or values;    -   detecting differences between the samples in a block and the        respective predicted samples;    -   frequency-separating the detected differences in respect of each        block so as to generate a corresponding array of        frequency-separated coefficients ordered according to increasing        spatial frequencies represented by the coefficients; and    -   entropy-encoding the frequency-separated coefficients using a        context adaptive arithmetic code which encodes coefficients with        respect to context variables indicative of the probability of a        coefficient having a particular coefficient value;    -   in which the entropy-encoding step comprises:    -   partitioning each array into two or more coefficient groups, the        groups being non-square sub-arrays; and    -   selecting a context variable to encode a coefficient according        to the spatial frequencies represented by that coefficient and        in dependence upon the values of coefficients in one or more        nearby groups of coefficients in that array or an array        corresponding to a neighbouring block of samples.

2. A method according to clause 1, in which the entropy-encoding stepcomprises encoding the coefficients of an array in an order dependentupon a scan pattern selected from a set of one or more candidate scanpatterns.

3. A method according to clause 2, in which each group of coefficientsin an array comprises a successive set of n coefficients in the orderdefined by the scan pattern applicable to that array, where n is aninteger factor of the number of coefficients in the array.

4. A method according to clause 3, in which n is 16.

5. A method according to any one of the preceding clauses, in which theselecting step allocated coefficients in a group to one of a set ofcandidate context variables so that, within each group, successivesubsets of coefficients, in the scan order, are allocated to respectiveones of the candidate context variables.

6. A method according to any one of the preceding clauses, in which theselecting step depends upon whether the nearby coefficients have a zerovalue.

7. A method according to clause 6, there being two candidate contextvariables for each group of coefficients.

8. A method according to clause 6 or clause 7, in which:

-   -   the coefficients are ordered within an array so that horizontal        spatial frequency increases from left to right in the array and        vertical spatial frequency increases from top to bottom in an        array;    -   if both the groups to the right and below the current group        contain non-zero coefficient data, then one context variable is        allocated by the selecting step to the first m coefficients of        the current group in the scan order and another context variable        to the remaining coefficients of the current group;    -   if the group to the right of the current group has non-zero data        but the group below the current group does not, then one context        variable is allocated by the selecting step to an upper half of        the current group and another context variable to the remaining        coefficients of the current group;    -   if the group below the current group has non-zero data but the        group to the right of the current group does not, then one        context variable is allocated by the selecting step to the first        p coefficients of the current group in the scan order and        another context variable to the remaining coefficients of the        current group; and    -   if the group below the current group has non-zero data but the        group to the right of the current group does not, then one        context variable is allocated by the selecting step to an left        half of the current group and another context variable to the        remaining coefficients of the current group;    -   where m and p are integers, and m does not equal p.

9. A method according to clause 8, in which a current group comprises asub-array of 8×2 or 2×8 coefficients; and m=13 and p=6.

10. A method according to any one of clauses 6 to 9, in which, if agroup of coefficients nearby a current group has not yet beenfrequency-separated, the selecting step assigns zero values to thatgroup for the purposes of selecting a context variable for a coefficientin the current group.

11. A method according to any one of clauses 6 to 9, in which, if afirst group of coefficients nearby a current group has not yet beenfrequency-separated, but a second group neighbouring a current group hasbeen frequency-separated, then the selecting assigns the values of thesecond group to the first group for the purposes of selecting a contextvariable for a coefficient in the current group

12. A method according to any one of the preceding clauses, in which theblocks of samples have a size of at least 8 samples in at least onedimension.

13. A method according to any one of the preceding clauses, in which atleast some of the blocks of samples are square.

14. A method according to any one of the preceding clauses, in which atleast some of the blocks of samples are non-square.

15. A method of video data coding, comprising:

-   -   predicting blocks of luminance and/or chrominance samples of an        image from other respective reference samples or values;    -   detecting differences between the samples in a block and the        respective predicted samples;    -   frequency-separating the detected differences in respect of each        block so as to generate a corresponding array of        frequency-separated coefficients ordered according to the        spatial frequencies represented by the coefficients, one of the        coefficients representing a dc value of the block; and    -   entropy-encoding the frequency-separated coefficients using a        context adaptive arithmetic code which encodes coefficients with        respect to context variables indicative of the probability of a        coefficient having a particular coefficient value;    -   in which the entropy-encoding step comprises:    -   partitioning each array into two or more coefficient groups, the        groups being non-square sub-arrays; and    -   generating an allocation of context variables to encode        respective coefficients generated in respect of a non-square        sub-array according to the spatial frequencies represented by        that coefficient, by position-repeating the context variable        allocations applicable to a square sub-array, but not        position-repeating the allocation of a context variable to the        dc coefficient.

16. A method according to clause 15, in which, in respect of thenon-square block, the context variable allocated to the dc coefficientis not allocated to any other coefficient.

17. Computer software which, when executed by a computer, causes thecomputer to carry out a method according to any one of the precedingclauses.

18. A machine-readable non-transitory storage medium which storessoftware according to clause 17.

19. A data signal comprising coded data generated according to themethod of any one of clauses 1 to 16.

20. Video data coding apparatus, comprising:

-   -   a predictor configured to predict blocks of luminance and/or        chrominance samples of an image from other respective reference        samples or values;    -   a detector configured to detect differences between the samples        in a block and the respective predicted samples;    -   a transform unit configured to frequency-separate the detected        differences in respect of each block so as to generate a        corresponding array of frequency-separated coefficients ordered        according to increasing spatial frequencies represented by the        coefficients; and    -   an entropy encoder configured to entropy-encode the        frequency-separated coefficients using a context adaptive        arithmetic code which encodes coefficients with respect to        context variables indicative of the probability of a coefficient        having a particular coefficient value;    -   in which:    -   the entropy-encoder is configured to partition each array into        two or more coefficient groups, the groups being non-square        sub-arrays, and to select a context variable to encode a        coefficient according to the spatial frequencies represented by        that coefficient and in dependence upon the values of        coefficients in one or more nearby groups of coefficients in        that array or an array corresponding to a neighbouring block of        samples.

21. Video data coding apparatus, comprising:

-   -   a predictor configured to predict blocks of luminance and/or        chrominance samples of an image from other respective reference        samples or values;    -   a detector configured to detect differences between the samples        in a block and the respective predicted samples;    -   a transform unit configured to frequency-separate the detected        differences in respect of each block so as to generate a        corresponding array of frequency-separated coefficients ordered        according to the spatial frequencies represented by the        coefficients, one of the coefficients representing a dc value of        the block; and    -   an entropy encoder configured to entropy-encode the        frequency-separated coefficients using a context adaptive        arithmetic code which encodes coefficients with respect to        context variables indicative of the probability of a coefficient        having a particular coefficient value;    -   in which the entropy encoder is configured to partition each        array into two or more coefficient groups, the groups being        non-square sub-arrays, and to generate an allocation of context        variables to encode respective coefficients generated in respect        of a non-square sub-array according to the spatial frequencies        represented by that coefficient, by position-repeating the        context variable allocations applicable to a square sub-array,        but not position-repeating the allocation of a context variable        to the dc coefficient.

22. Video storage, transmission, capture or display apparatus comprisingapparatus according to clause 21 or clause 22.

Further respective embodiments are defined by the following numberedclauses:

1. A video coding or decoding method in which luminance and chrominancesamples of an image are predicted from other respective referencesamples derived from the same image according to a prediction modeassociated with a sample to be predicted, the chrominance samplesrepresenting first and second chrominance components;

the method comprising:

selecting, for at least some samples, the same prediction mode for eachof the luminance and chrominance components corresponding to an imageregion.

2. A video coding or decoding method in which luminance and chrominancesamples of an image are predicted from other respective referencesamples derived from the same image according to a prediction modeassociated with a sample to be predicted, the chrominance samplesrepresenting first and second chrominance components;

the method comprising:

selecting, for at least some samples, different respective predictionmodes for each of the luminance and chrominance components correspondingto an image region.

3. A method according to clause 1 or clause 2, comprising the step of:

selecting either the same prediction mode or different respectiveprediction modes for each of the luminance and chrominance componentscorresponding to an image region, the selection being made according toan image sequence, an image, or a region of an image.

4. A method according to clause 3, comprising, for an encodingoperation:

carrying out a first trial encoding of an image region using the sameprediction mode for the luminance and chrominance components;

carrying out a second trial encoding of that image region usingdifferent respective prediction modes for the luminance and chrominancecomponents; and

selecting either the same prediction mode or different respectiveprediction modes for use in respect of a picture sequence, a picture, ora region of a picture on the basis of the data encoded by the first andsecond trial encodings.

5. A method according to clause 4, comprising the step of:

detecting one or more predetermined properties of the data encoded bythe first and second trial encodings; and

selecting either the same prediction mode or different respectiveprediction modes for use in respect of a picture sequence, a picture, ora region of a picture on the basis of the detected one or moreproperties.

6. A method according to clause 5, in which the one or more propertiescomprise properties selected from the set consisting of:

image noise;

image distortion; and

image data quantity.

7. A method according to any one of clauses 4 to 6, in which theselection is made for individual image slices or image blocks.

8. A method according to any one of clauses 4 to 7, comprising:

associating information with the encoded video signal indicating:

whether the same prediction modes or different prediction modes areused; and

in the case that the same prediction mode is used, an identification ofthat single prediction mode; or

in the case that different respective prediction modes are used, anidentification of those different respective prediction modes.

9. A method according to any one of clauses 1 to 3, in which, for adecoding operation, the method comprises:

detecting information associated with video data for decoding, theinformation defining whether the same prediction mode or differentprediction modes are associated with the video data for decoding.

10. A method according to any one of the preceding clauses, in which theimage forms part of a 4:2:2 or a 4:4:4 video signal.

11. Computer software which, when executed by a computer, causes thecomputer to carry out a method according to any one of the precedingclauses.

12. A machine-readable non-transitory storage medium which storessoftware according to clause 11.

13. A data signal comprising coded data generated according to themethod of any one of clauses 1 to 10.

14. A video coding or decoding apparatus in which luminance andchrominance samples of an image are predicted from other respectivereference samples derived from the same image according to a predictionmode associated with a sample to be predicted, the chrominance samplesrepresenting first and second chrominance components;

the apparatus comprising a controller configured to select, for at leastsome samples, the same prediction mode for each of the luminance andchrominance components corresponding to an image region.

15. A video coding or decoding apparatus in which luminance andchrominance samples of an image are predicted from other respectivereference samples derived from the same image according to a predictionmode associated with a sample to be predicted, the chrominance samplesrepresenting first and second chrominance components;

-   -   the apparatus comprising a controller configured to select, for        at least some samples, different respective prediction modes for        each of the luminance and chrominance components corresponding        to an image region.

16. Apparatus according to clause 14 or clause 15, in which thecontroller is configured to select either the same prediction mode ordifferent respective prediction modes for each of the luminance andchrominance components corresponding to an image region, according to animage sequence, an image, or a region of an image.

17. Video storage, transmission, capture or display apparatus comprisingapparatus according to any one of clauses 14 to 16.

The invention claimed is:
 1. A data decoding apparatus comprising:parameter detector circuitry configured to detect from a receivedbitstream whether intra prediction is enabled in the data and fordetecting a prediction mode for a block of samples represented in thebitstream based on detection of whether a chrominance format of thereceived bitstream is 4:2:2, 4:4:4, or 4:2:0; selector circuitryconfigured to determine a scan pattern from a plurality of scan patternsfor scanning frequency coefficients, the scan patterns being associatedwith the detected prediction mode by a mapping, chrominance andluminance samples being arranged in blocks, and the mapping beingdifferent for the chrominance and luminance samples when the chrominanceformat is 4:2:2 and the blocks of the chrominance samples have adifferent aspect ratio relative to blocks of the luminance samples; anddecoder circuitry configured to scan frequency coefficients representingthe blocks of chrominance samples and the blocks of luminance samples inan order of the determined scan pattern, which depends on the detectedprediction mode, to decode video data from the bitstream, and to outputan image signal for generation of a reconstructed output image and/or apredicted image signal.
 2. A data decoding apparatus according to claim1, wherein the parameter detector circuitry is configured to detectparameter information in the bitstream indicating whether intraprediction is enabled and the prediction mode for a block of samples. 3.A data decoding apparatus according to claim 1, where the mapping isstored data in a look up table.
 4. A data decoding apparatus accordingto claim 1, wherein the decoder circuitry is further configured to applyfiltering as part of the decoding the video data.
 5. A data decodingapparatus according to claim 1, wherein the prediction mode for a blockof samples is a prediction direction.
 6. A data decoding apparatusaccording to claim 5, wherein the prediction mode is selected from among33 prediction directions.
 7. A data decoding apparatus according toclaim 1, wherein the selector circuitry is configured to determine ahorizontal scan pattern in respect for a predominantly verticalprediction mode, to determine a vertical scan pattern in respect ofpredominantly horizontal prediction modes, and to determine a diagonalscan pattern in respect of other prediction modes.
 8. A data decodingapparatus according to claim wherein the bitstream represents 4:2:2video data, and the mapping is different for 4:2:2 blocks of luminancesamples and 4:2:2 blocks of chrominance samples.
 9. A data decodingapparatus according to claim 8, wherein the blocks of luminance samplesare 8×8 blocks and the blocks of chrominance samples are 4×8 blocks. 10.A data decoding apparatus according to claim 8, wherein the 4:2:2 blocksof luminance samples and 4:2:2 blocks of luminance samples are TransformUnits.
 11. A data decoding apparatus according to claim wherein thebitstream represents 4:2:2 video data.
 12. A data decoding methodcomprising: detecting from a received bitstream whether intra predictionis enabled in the data; detecting a prediction mode for a block ofsamples represented in the bitstream based on detection of whether achrominance format of the received bitstream is 4:2:2, 4:4:4, or 4:2:0;determining a scan pattern from a plurality of scan patterns forscanning frequency coefficients, the scan patterns being associated withthe detected prediction mode by a mapping, chrominance and luminancesamples being arranged in blocks, and the mapping being different forthe chrominance and luminance samples, when the chrominance format is4:2:2 and the blocks of the chrominance samples have a different aspectratio relative to blocks of the luminance samples; scanning frequencycoefficients representing the blocks of chrominance samples and blocksof luminance samples in an order of the determined scan pattern, whichdepends on the detected prediction mode; decoding video data from thebitstream; and outputting an image signal for generation of areconstructed output image and/or a predicted image signal.
 13. A datadecoding method according to claim 12, further comprising: determining ahorizontal scan pattern in respect for a predominantly verticalprediction mode; determining a vertical scan pattern in respect ofpredominantly horizontal prediction modes; and determining a diagonalscan pattern in respect of other prediction modes.
 14. A data decodingmethod according to claim 12, wherein the bitstream represents 4:2:2video data, and the mapping is different for 4:2:2 blocks of luminancesamples and 4:2:2 blocks of chrominance samples.
 15. A data decodingapparatus according to claim 12, wherein the bitstream represents 4:2:2video data.
 16. A non-transitory storage medium comprising computerexecutable instructions, which when executed by a computer cause thecomputer to carry out the method according to claim
 12. 17. A videostorage, reception, capture or display apparatus comprising the datadecoding apparatus of claim
 1. 18. A video capture apparatus comprisingelectronic memory and a display configured under the control of aprocessor to display video data decoded by the apparatus of claim
 1. 19.A data decoding apparatus according to claim 1, wherein the mapping ofthe chrominance and luminance samples is such that a first plurality ofluminance prediction directions substantially align with respectivechrominance prediction directions, and a second plurality of luminanceprediction directions do not substantially align with any chrominanceprediction directions.